Find the 2nd to last record??

mohsinhq

Registered User.
Local time
Today, 02:10
Joined
Aug 2, 2004
Messages
90
Hi,

Need some help with a query im working on please!

At our company, we record a customers name with a date every time a particular event occurs.

I need to find out the difference between 2 dates for a customer and present the number of days. The two dates to be subtracted are the most recent record minus the 2nd to most recent record. (i.e. [Max] - [Max less 1]

currently, the problem is finding the 2nd to last record for a particular customer so that i can subtract it. ive tried using Min but this finds the first record.

I need to show all results simultaneously.

look forward to your suggestions. thanks!
 
Thanks Brian. Did the Trick!

1. Query Created to find the Max date
2. Second Query to find max date where not equal to Max date in Query 1
 
Yep and put the two together for the datediff.

Glad to help

brian
 

Users who are viewing this thread

Back
Top Bottom