Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Date-based criteria and can't figure out how to do it

Status
Not open for further replies.

kirnavi

Technical User
Feb 4, 2002
29
US
What I need is criteria for a date field that essentially says, "Grab everything that is for the month before the current month and on back." In other words, it is now August 2004 and I would need to grab everything that is July 2004 and backwards. I've been playing with various queries involving Iif and Month functions but none of them work quite right, especially when I try and put in criteria involving the December/January crossover.

Thanks in advance for any help!
 
Code:
<= datedif(mm,-1,DateField)

Is this what you are looking for?
 
And what abiut this ?
<=DateSerial(Year(Date()),Month(Date()),0)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top