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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Criteria

Status
Not open for further replies.

I50

Technical User
Joined
Jul 27, 2001
Messages
7
Location
US
Please Help me on this one,

I have a Query that I want to interrogate records that has a "Date" thats more than five years old. How do I code the criteria for selecting these records. I tried using
the 'DateAdd' function, such as, ">DateAdd("m",60,Date())".
But, I'm not getting the proper results. Need Help! Thanks.
 

>DateSerial(DatePart("Y",Date)-5,DatePart("m",Date),DatePart("d",Date)) JHall
 

The following expression when run comes up with a message that says, "Data type Mismatch in Criteria expression". Why is this?

>DateSerial(DatePart("y","Date")-5,DatePart("m","Date"),DatePart("d","Date"))
 
replace each of the "Date" with Date() with no quotes JHall
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top