This is hard to explain - so I can only hope that someone understands and knows a solution...
I want to update a "JOB" field in table "PERSON" to a field from a source file "JOBS".
The tables are linked via a unique id for each person, "SSN"
The problem is that each PERSON may have multiple records in the "JOBS" table, and I only want to select the record with the most recent JOB.
There is another field in the JOBS table that contains the "JOB DATE"
For example:
SSN.........JOB...........JOB_DATE
123456789.........2A................1/1/2000
123456789.........3A.................2/2/2008
987654321..........4A.................1/1/2003
987654321...........5A.................3/3/2005
For each "SSN", I want to select the "JOB" that has the most recent "JOB DATE".
I'm completely stumped and feeling a little stupid at the moment...
My first instinct was to use the DMax function as a criteria on the DATE column, but I can't think of a way to do get the DMax for each SSN instead of the whole column....
Would appreciate any inpunt.
I want to update a "JOB" field in table "PERSON" to a field from a source file "JOBS".
The tables are linked via a unique id for each person, "SSN"
The problem is that each PERSON may have multiple records in the "JOBS" table, and I only want to select the record with the most recent JOB.
There is another field in the JOBS table that contains the "JOB DATE"
For example:
SSN.........JOB...........JOB_DATE
123456789.........2A................1/1/2000
123456789.........3A.................2/2/2008
987654321..........4A.................1/1/2003
987654321...........5A.................3/3/2005
For each "SSN", I want to select the "JOB" that has the most recent "JOB DATE".
I'm completely stumped and feeling a little stupid at the moment...
My first instinct was to use the DMax function as a criteria on the DATE column, but I can't think of a way to do get the DMax for each SSN instead of the whole column....
Would appreciate any inpunt.