KeyserSoze
Programmer
I have a Microsoft Access query that gives me a list of records from a table. Each record has an identifiable key based on QUARTER_CODE, PERSON_ID_NUMBER and APPLICATION_NUMBER:
I need to determine the record within each QUARTER_CODE/PERSON_ID_NUMBER/APPLICATION_NUMBER group with greatest APPLICATION DATE.
So far I am stuck at how to formulate toe MAX logic.
Thanks in advance!
Code:
SELECT DECS_HIST.PERSON_ID_NUMBER,
DECS_HIST.QUARTER_CODE,
DECS_HIST.APPLICATION_NUMBER,
DECS_HIST.APPLICATION_DATE
FROM DECS_HIST
WHERE (((DECS_HIST.QUARTER_CODE)=[Forms]![MAIN]![Current_Term])) OR
(((DECS_HIST.QUARTER_CODE)=[Forms]![MAIN]![One_Year]) AND ((DECS_HIST.APPLICATION_DATE)<[Forms]![MAIN]![Cutoff_Week_One_Year])) OR
(((DECS_HIST.QUARTER_CODE)=[Forms]![MAIN]![Two_Year]) AND ((DECS_HIST.APPLICATION_DATE)<[Forms]![MAIN]![Cutoff_Week_Two_Year]))
ORDER BY DECS_HIST.QUARTER_CODE, DECS_HIST.PERSON_ID_NUMBER, DECS_HIST.APPLICATION_NUMBER, DECS_HIST.APPLICATION_DATE;
I need to determine the record within each QUARTER_CODE/PERSON_ID_NUMBER/APPLICATION_NUMBER group with greatest APPLICATION DATE.
So far I am stuck at how to formulate toe MAX logic.
Thanks in advance!