Querie question

  • Thread starter Thread starter Thomas
  • Start date Start date
T

Thomas

Hello,

I work for a wireless phone provider, and every now and
then other carriers will send us a document called TDS.

Right now I have a database that shows the name of the
carrier, and what date we last received a TDS from them.

I have made a query that is suppose to check the database
for any carriers that havent sent anything prior to a
date set in the query. Now what I'd like to do is not
have to keep updating this date in the query, but have
the query know todays date, and show me all the carriers
that havent sent me an update for 60 days. Is this
possible?

Thanks,
Thomas
 
Instead of the hard-coded date in your query's criteria line, try this:
Date() - 60
This will return a date 60 days before the current date.

HTH
- Turtle
 
I have made a query that is suppose to check the database
for any carriers that havent sent anything prior to a
date set in the query. Now what I'd like to do is not
have to keep updating this date in the query, but have
the query know todays date, and show me all the carriers
that havent sent me an update for 60 days. Is this
possible?

Even easy. Use the DateAdd function:

DateAdd("d", -60, Date())

will be the day sixty days prior to the day the query is run.

To select those carriers who have not sent anything in the past sixty
days, use a criterion of

CarrierID NOT IN(SELECT CarrierID FROM tablename WHERE datefield >
DateAdd("d", -60, Date()))
 
Back
Top