Date headache

Skotor

Registered User.
Local time
Today, 05:16
Joined
Jan 30, 2003
Messages
23
Hello,
I am making a query that is using several fields from differant tables. In one of the tables I'm using there is a date field. In this query I need to list the last 2 dates closest to the current date. I'm needing the last 2 dates for a report I will be generating from this query, one will be the "Most Recent SVC Date" the other will be the "Prior SVC Date".

Any tips or idea on how to go about doing this? I do not know VB scripting so I don't believe that's an option (though it's prob the easiest way) Thanks all!
 
Here's a simple solution:

You could try sorting the query by date (descending) and then setting the max records=2. That should return the last two records.

See if that helps.
 
Look at the TOP values property of the query (check out MS Access help). Have your date field be the first field in the query grid - have the date field sorted in descending order...then select the Top 2 values.

HTH
E
 
Last edited:
Thanks Elana!

Did eactly what I needed it to do.
 

Users who are viewing this thread

Back
Top Bottom