98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Access Training and help » Running a date query to show records from the previous month
Running a date query to show records from the previous month
Resolved · Medium Priority · Version 2007
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
Fri 18 Feb 2011: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Access tip:Random samplingData is th key to a good database, therefore checking is essential. |