我在外部数据库做了一个视图,在视图上面转了日期和时间格式。- SELECT
- emp.name AS [姓名],
- timer_original_rec.card_no AS [卡号],
- CONVERT ( DATE, dbo.timer_original_rec.mark_date, 8 ) AS [打卡日期],
- emp.state AS [员工状态],
- CAST (
- STUFF( STUFF( LEFT ( dbo.timer_original_rec.mark_time + '0000000', 6 ), 3, 0, ':' ), 6, 0, ':' ) AS TIME
- ) AS [打卡时间]
- FROM
- dbo.timer_original_rec
- INNER JOIN
- dbo.emp
- ON
- timer_original_rec.card_no = emp.emp_card_no
复制代码
|