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
17 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 49

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 49

Expert Comment

by:Gustav Brock
ID: 41828328
You are welcome!

/gustav
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

758 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now