0

我只需要显示日期时间选择。但在表文件TA 中显示所有日期时间。

这段代码:

SELECT *
FROM filesTA tf
WHERE NOT tf.EmpNo 
IN (
SELECT lr.EmployeeRun
FROM LeaveRecord lr
WHERE lr.StartDate = '2012-10-01'
)

输出:

EmpNo | ChkDate | ChkIn | ChkOut
00001 | 2012-10-01 00:00:00.000 | 2012-10-01 07:21:00.000 | 2012-10-01 12:21:00.000
00002 | 2012-10-01 00:00:00.000 | 2012-10-01 08:13:00.000 | 2012-10-01 19:55:00.000
00003 | 2012-10-15 00:00:00.000 | 2012-10-15 07:06:00.000 | 2012-10-15 20:12:00.000
00004 | 2012-10-22 00:00:00.000 | 2012-10-22 07:12:00.000 | 2012-10-22 19:15:00.000

我需要输出:

EmpNo | ChkDate | ChkIn | ChkOut
00001 | 2012-10-01 00:00:00.000 | 2012-10-01 07:21:00.000 | 2012-10-01 12:21:00.000
00002 | 2012-10-01 00:00:00.000 | 2012-10-01 08:13:00.000 | 2012-10-01 19:55:00.000

谢谢你的时间。

4

1 回答 1

1
SELECT *
FROM filesTA tf
WHERE  tf.EmpNo NOT
IN (
SELECT lr.EmployeeRun
FROM LeaveRecord lr
WHERE lr.StartDate = '2012-10-01'
)
于 2012-11-28T11:33:14.830 回答