Hi,
You could set-up this using a VBA procedure.
As below (no error hadling amnd I made the assumption MonthDate is date
type):
din DAO.db as database, rs1 as DAO.recordset, rs2 as DAO.recordset, DestRS
as DAO.recordset
set db = currentdb
set DestRS = db.OpenRecordset("DestTable")
set rs1= db.openrecordset("select distinct SSN, MonthDate from
CurrentTable")
if rs1.recordcount >0 then ' there are records
do while not rs1.eof
'(*)
set rs2 = db.openrecordset("select * from CurrentTable where ssn='"
& rs1!SSN & "' and MonthDate =#" & rs1!MonthDate & "# order by Category")
if rs2.recordcount >0 then
DestRS.AddNew
do while not rs2.eof
DestRS.Fields("Cat" & rs2!Category & "Hours") =rs2!Hours
rs2.MoveNext
Loop
DestRS.Update
endif
rs1.MoveNext
Loop
endif
If you need any more help, you can contact me.
HTH,
Bogdan Zamfir
_________________________
Independent consultant
Jim said:
Hi Bogdan Zamfir, Thanks for your response
Perhaps an example;
Current Table Records
SSN MonthDate Category Hours
538-22-1729 January 2003 1 36.2
538-22-1729 January 2003 2 15.8
538-22-1729 January 2003 3 12.5
Convert to new Table
SSN MonthDate CAT1Hours CAT2Hours CAT3Hours
538-22-1729 January 2003 36.2 15.8
12.5