Solved

Need help filtering dates in Access Query to return all records with date greater than or equal to the past two months.

Posted on 2016-10-04
3
35 Views
Last Modified: 2016-10-04
I want to be able to pull in all records where the date is greater than or equal to the past two months. So, if I ran this query right now I would get all records with a date greater than or equal to 9/1/2016.

I get particularly hung up when trying to figure out how to make this work when crossing the new year. If the report is run on 1/10/2017 I need it to also pull in all records where the date is greater than or equal to 12/1/2016.

Thanks for the help!
0
Comment
Question by:SeyerIT
  • 2
3 Comments
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 41828322
That will be:

Where YourDateField Between DateSerial(Year(Date()), Month(Date()) - 1, 1) And Date()

/gustav
0
 
LVL 2

Author Comment

by:SeyerIT
ID: 41828325
EXCELLENT! Thanks so much!
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 41828328
You are welcome!

/gustav
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question