Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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())
 
So the formula will be something like Between DateAdd("m",-9,Date(04/01/06))
and DateAdd("m",-12,Date(04/01/06))??
 
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.
 

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

Similar Threads

Query by month and year 5
Error on Query with DateSerial() 0
Date search query 0
Count occurrences 1
Query Totals 3
Crosstab Date Range Problem 3
Queries 8
Excel Vba to change displayed year automatically. 14

Back
Top