I have a Database (Microsoft SQL Server Express 2005) that contains the following data table:
-DATE--------TIME----LEVEL
19/11/2008 - 8:00am - 05
19/11/2008 - 9:00am - 10
20/11/2008 - 8:00am - 06
20/11/2008 - 9:00am - 11
21/11/2008 - 8:00am - 12
...
This data can span as far back as 2-3 months...
I want to find a way to return a Dataset for each of the last 7 days. Writing these queries is pretty easy if I know the DATE corresponding to the last 7 days.
Is there anyway to calculate such a thing?
For example get Now(), then Now()-1, Now()-2, etc... or something similar?
Any help would be greatly appreciated.
Thanks,
-DATE--------TIME----LEVEL
19/11/2008 - 8:00am - 05
19/11/2008 - 9:00am - 10
20/11/2008 - 8:00am - 06
20/11/2008 - 9:00am - 11
21/11/2008 - 8:00am - 12
...
This data can span as far back as 2-3 months...
I want to find a way to return a Dataset for each of the last 7 days. Writing these queries is pretty easy if I know the DATE corresponding to the last 7 days.
Is there anyway to calculate such a thing?
For example get Now(), then Now()-1, Now()-2, etc... or something similar?
Any help would be greatly appreciated.
Thanks,