Date comparison in SQL Server 2008

printmedia
printmedia used Ask the Experts™
on
Hi all.

I have a SQL Server 2008 query as follows:

SELECT     Expired, ExpirationDate
FROM         myTable
WHERE     (ExpirationDate < { fn NOW() })

Open in new window


The problem is, if the expiration date is 2014-03-04 it appears in the results when compared to today. The ExpirationDate field is a date Data Type. What am I doing wrong? Do I need to format NOW()?

Thank you in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Cast now as a Date.

CAST(GETDATE() AS DATE)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial