i think you use datediff function and its work fine.
like
;WITH WCTE AS(
Select Header, Convert(DateTime,Value,110) ServiceDate2
from tblUdrElement
Where 1=1 and Header = 'Service Date'
)SELECT * FROM WCTE
wheredatediff(d,ServiceDate2 , '2012-01-01 00:00:00.000') >=0
order by 1
No comments:
Post a Comment