running date query show
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum 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

resolvedResolved · Medium Priority · Version 2007

replyReply Fri 11 Feb 2011, 12:26Delegate Jamie said...

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

For upcoming training course dates see: Pricing & availability

replyReply Fri 11 Feb 2011, 15:47Trainer Anthony said...

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.

 

Please browse our web site to find out more about
access courses and other Microsoft training courses.

Access tip:

Zoom feature for queries

If youare working on on query design and creating a calculated field, it can be hard to view the whole statement. You can hold the shift key down and press F2, to show the zoomed up version of the query field

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard