Tuesday, July 12, 2005

SQL Server Query for all values within a month

I have been working on a project at work and I discovered the following works for retrieving dates from SQL Server:

SELECT * FROM view_Employees_Awards WHERE stringDate BETWEEN '2005-06-01' AND
'2005-07-01' ORDER BY Awarded_Date DESC

The following brings back every date from the beginning of 2005-06-01 00:00:00

To

2005-06-01 23:59:59


Post a Comment