I want to run a query which will use getdate and dateadd to look at records which match a date within a six month (180 day) range.
The following query returns 0 records. There are thousands of records that I should see, but I think there is something wrong with my formatting, so it doesn't find any matches:
All help is much appreciated.
MrsBean
The following query returns 0 records. There are thousands of records that I should see, but I think there is something wrong with my formatting, so it doesn't find any matches:
Code:
SELECT dbo.[Meter Activity].*, Date AS Expr1
FROM dbo.[Meter Activity]
WHERE (Date BETWEEN CONVERT(datetime, GETDATE(), 110) AND CONVERT(datetime, DATEADD(dd, - 180, GETDATE()), 110))
All help is much appreciated.
MrsBean