I have struggled with this for a long time...
I am trying to write a SQL Statement in Access to pull out the most recent and Second most recent service dates from a service table called Cleaning
.
Sample Raw Data:
Premises_No Date_Cleaned
1 12-Jun
1 15-Jul
1 14-Aug
2 15-Jan
2 18-Feb
2 17-Apr
2 14-May
2 06-Jun
2 11-Jul
2 16-Aug
6 10-Dec
6 12-Jan
6 20-Feb
6 13-Mar
6 15-Apr
6 15-May
6 11-Jun
6 13-Jul
6 10-Aug
So the executed SQL would yield:
Premises_No MostRecent 2ndMostRecent
1 14-Aug 15-Jun
2 16-Aug 11-Jul
6 10-Aug 13-Jul