Todays date minus 6 days before (Shows all records in 6 days)

G

Guest

Im trying to write a query that says todays date (=Date()) minus 6 days. But
i want the query to show me everything from today and the 6 days before. I
have one column to add this into.

Can anyone help?

Thanks
 
S

Stefan Hoffmann

hi,
Im trying to write a query that says todays date (=Date()) minus 6 days. But
i want the query to show me everything from today and the 6 days before. I
have one column to add this into.
Just use it as criteria in your query:

SELECT *
FROM [yourTable]
WHERE [yourDatefield] >= Date() - 6



mfG
--> stefan <--
 
G

Guest

Rach

I'd recommend the following:

SELECT *
From [yourTable]
WHERE [yourDateField] BETWEEN DateAdd("d", -6, date()) AND Date()

Keep in mind, if your Date field has time values in it that the above will
not actually return any values for todays date. If that is the case, replace
[yourDateField] with DateValue([yourDateField]).

HTH
Dale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top