select case when [Estimated Return Date] <= DATEDIFF(day, -90, GETDATE()) then
'90 Days or Less To Estimated Return Date' else '' end as 'Alert', [No_]
from [Rental Header]
where [Estimated Return Date] != '1/1/1753'
问题在于它通过添加where子句消除了我需要查看的许多记录。
答案 0 :(得分:3)
作为绷带,您可以这样做(最好将NULL用于1753):
hKW