Queries

C

cardfan057

I am trying to produce a query that will show sales dates between 9 months
and a year ago, what would be the best way to show those results.
 
F

fredg

I am trying to produce a query that will show sales dates between 9 months
and a year ago, what would be the best way to show those results.

As criteria on the SalesDate field:
Between DateAdd("m",-9,Date()) and DateAdd("m",-12,Date())
 
C

cardfan057

So the formula will be something like Between DateAdd("m",-9,Date(04/01/06))
and DateAdd("m",-12,Date(04/01/06))??
 
F

fredg

So the formula will be something like Between DateAdd("m",-9,Date(04/01/06))
and DateAdd("m",-12,Date(04/01/06))??


cardfan057


fredg said:
As criteria on the SalesDate field:
Between DateAdd("m",-9,Date()) and DateAdd("m",-12,Date())

No, the 'formula' is exactly what I wrote.
Date() is a built-in Access function which returns the current date.
You do not write it in as you have above.
To verify this, press Ctrl + G
When the debug window opens, write
? Date()
It will print the current date.

I would suggest, while the debug window is still open, that you then click
on Help, and type Date in the Index box.
Find all of the Date and Time functions available and read up on their usage.
 
Top