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
31 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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…

856 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