Jamie has attended:
Access Introduction course
Access Intermediate course
Running a date query to show records from the previous month
I have a table which I add records to daily, one of the fields is a date field.
I want to run a query that returns all the records from the previous month. According to the Access help I should be using this criteria:
Year(Date())*12+DatePart("m",Date())-1
However, it's not returning any results.
Please help!
Cheers,
Jamie
RE: Running a date query to show records from the previous month
Hi Jamie, thanks for your query. Difficult to advise on this one without seeing the criteria in context with the query and your data. However, why not try a parameter query?
Try this criteria on the date field
"Between [Enter Start Date] And [Enter End Date]"
...which should prompt the user to enter the dates, and pull out the relevant information or alternatively, or if you want it to happen automatically:
Between Date( ) And DateAdd("M", -1, Date( ))
Hope this helps,
Anthony