Converting the dates first in the Select Statement
I used this:
SELECT CONVERT(varchar , DATEADD(day, -1, GETDATE()), 101) AS yDate, CONVERT(varchar , yourDateHere, 101) AS sDate
FROM yourTableHere
WHERE stuff meets your parameters...
This way both the dates we are comparing are in the same format "mm/dd/yyyy."
You can use CAST but this seems a bit cleaner to me....
Leave a comment: