• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 51
  • Last Modified:

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

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
SeyerIT
Asked:
SeyerIT
  • 2
1 Solution
 
Gustav BrockCIOCommented:
That will be:

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

/gustav
0
 
SeyerITAuthor Commented:
EXCELLENT! Thanks so much!
0
 
Gustav BrockCIOCommented:
You are welcome!

/gustav
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now