仅需要此查询的最近日期 [英] Need only recent dates from this query
本文介绍了仅需要此查询的最近日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
SELECT * FROM dbo.EmpCstFV
RIGHT JOIN Employee ON EmpCstFV.EmpUID = Employee.EmpUID
WHERE CONVERT(datetime,EmpGCstF2,110) < (DateAdd(day,30,getdate())) AND CONVERT(datetime,EmpGCstF2,110) <= getdate() AND CstID = '57' AND EmpGCstF1 = 'DOT Medical Certificate'
Help?
推荐答案
EmpGCstF2 =到期日期
当前查询显示DOT Med Cert字段的所有记录.我只希望它显示最新记录.有一些DOT记录已在2009年过期,但我只想最近已过期的记录
EmpGCstF2 = Expiration Date
The current query shows all records for the field DOT Med Cert. I only want it to show the most recent records. There are DOT records that have expired in 2009 but I just want the records that have expired recently
这篇关于仅需要此查询的最近日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文