Q:

Access query results for last 7 days on a SmallDateTime (SQL) table

I have an Access frontend with an SQL Server backend.
I have a table with many records, with a smalltimedate column "Observed_date" (yyyy/mm/dd hh:mm:ss).
I want to write a query to return all the records in the table for the last 7 days (i.e. BETWEEN Date() and Date()-7).
I understand I need to drop the "time" value on the column, so in my query I'm doing the following:
SELECT INT((table.field)) AS JustDate FROM table;

This returns just the date value for every record in the table.
But what do I do next to get just the last 7 days of records?
thanks,
Tom

A:

Well you don't need between for the last 7 days:
T-SQL
WHERE table.field >= CAST(GETDATE() - 7 AS DATE)

Access SQL
WHERE table.field >= Date() - 7

