Friday, February 17, 2012

Date Comparison excluding time

I have a stored procedure that is suppose to get all records that have an expiration date of today. My where clause is as follows:


Round2ExpDate <= getdate()

This is not working because of the time factore. What is the best way to truncate the time for each date? All recommendations are greatly appreciated.You can remove time by casting a datetime datatype as a varchar.

No comments:

Post a Comment