LastAdDate过去6个月内的行;
select cast('01-jan-1970' as datetime) as LastAdDate into #PubAdvTransData union select GETDATE() union select NULL union select '01-feb-2010'DECLARE @sp_Date DATETIME = DateAdd(m, -6, GETDATE())SELECT * FROM #PubAdvTransData pat WHERe (pat.LastAdDate > @sp_Date)>2010-02-01 00:00:00.000>2010-04-29 21:12:29.920
您确定
LastAdDate类型
DATETIME吗?
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)