# Revision history [back]

Hi

This question reminded me this one rather old (OMG 12 years already?)

You can get the result by the sequence of 3 queries.

• The first relates the table to itself and calculates the number of days.
• The second limits the result to the smallest date.
• The third relates the first two to get the desired result

In the following example, the table contains counter index statements.

What we want (run Q3 in C:\fakepath\DateDiffBetweenRecords.odb):

HTH - Regards