SQLTeam.com | Weblogs | Forums

Help with a query with DATE & time


#1

select *
from DC_LICENSE_PLATE_HISTORY
where SYS_REVISED_DATE_TIME = '04/30/2014 7:39'

How would i just query for example today's date the code above will not work


#2
WHERE   SYS_REVISED_DATE_TIME >= CAST(GETDATE() AS DATE)
        AND SYS_REVISED_DATE_TIME < DATEADD(DAY, 1, CAST(GETDATE() AS DATE))

It is saying that "give me everything where the SYS_REVISED_DATE_TIME is GREATER THAN OR EQUAL TO midnight today, and LESS than midnight tomorrow.