Selecting all today’s records

Dates can be difficult to work with especially when you are not interested in the time portion. So here’s a quick snippet that strips the time portion out of the equation, making it easy to get only today’s records (or any day for that matter).

SELECT Column1,Column2, Datestamp FROM tblExample
WHERE DATEADD(day, DATEDIFF(day, 0, GetDate()), 0) = DATEADD(day, DATEDIFF(day, 0, Datestamp), 0)

You can follow any responses to this entry through the RSS 2.0 feed.