Hi, having got my sql in some sort of order in a previous post I am trying to insert the sorted fields into another table.
Testing the code without the "Insert" clause it works fine, but when I come to try and insert the data into a table I get a warning from Access that it can't append all the files (see attached picture).
I have attached picture of the data as is appears in it's initial form imported from an excel s/s, and a picture of the data sorted as desired in the table but I need to get passed this hang up.
The fields Job Code, EmpName and WeekEnding are all set as a combined foreign key and are Indexed.
I have tried varying the Index properties for the fields in the table all to no avail.
Has anyone a direction they can point me in please?
Code as below:
Testing the code without the "Insert" clause it works fine, but when I come to try and insert the data into a table I get a warning from Access that it can't append all the files (see attached picture).
I have attached picture of the data as is appears in it's initial form imported from an excel s/s, and a picture of the data sorted as desired in the table but I need to get passed this hang up.
The fields Job Code, EmpName and WeekEnding are all set as a combined foreign key and are Indexed.
I have tried varying the Index properties for the fields in the table all to no avail.
Has anyone a direction they can point me in please?
Code as below:
Code:
INSERT INTO Tbl_Costing ( [Job Code], EmpName, HoursWorked, WeekEnding )
SELECT Tbl_Trial.[Job Code], Tbl_Trial.EmpName, Tbl_Trial.HoursWorked, Tbl_Trial.WeekEnding
FROM Tbl_Trial
GROUP BY Tbl_Trial.[Job Code], Tbl_Trial.EmpName, Tbl_Trial.HoursWorked, Tbl_Trial.WeekEnding
HAVING (((Tbl_Trial.[Job Code])>"") AND (NZ(Tbl_Trial.EmpName,'')<>''));