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!

date and above 1

Status
Not open for further replies.

tourguy

Technical User
Nov 6, 2003
27
US
I have a table called "table1". Within table1, i have a field name called "date inputted". In query, I want to try to pull out all of the dates older than 3 mnths from today. So today is March 12... what I want is pull out any date that is 3 mnths and above from today.
 
Put this as your criteria:

DateDiff("d",Date,[table1]![date inputted])>=90



HTH
Mike

[noevil]
 
I'm having problem getting this to work... The message error is "Data type mismatch in criteria expression". I tried modifying the things, but still popping up the same error.
 
Is your "date inputted" field a date format or text?

if it is text you will need to add a format statement:

DateDiff("d",Date,Format([table1]![date inputted],"Short Date"))>=90

Or change the field to a date/time field

HTH
Mike

[noevil]
 
Try:

Code:
DateDiff("d",Date(),[table1]![date inputted])>=90

Access may discard the () after Date, but you must type them in.

Also, it is not clear whether you want all entries older than three months ago, "older than 3 mnths from today", or if you want entries from three months ago through today, "any date that is 3 mnths and above from today".

The code above should give you all entries that were entered 90 days ago or older.


HTH,
Bob [morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top