SQL server datetime column filter on certain date or range of dates
- by MicMit
There is an example for today here
http://stackoverflow.com/questions/2583228/get-row-where-datetime-column-today-sql-server-noob
I am primarily interested in 2008 only. For today it looked like
SELECT (list of fields)
FROM dbo.YourTable
WHERE dateValue BETWEEN
CAST(GETDATE() AS DATE) AND DATEADD(DAY, 1, CAST(GETDATE() AS DATE))
What literal value of date(s) or functions ( I need a format ) should I place there to make it work independent of local settings.