G'day all, thanks in advance for reading.
I've got two tables, one that's full of data regularly externally updated called "tblEmployeeLic ences":
The other table is one that is depended upon by an ID-card printing program, and as such only allows a single row per employee, called "IDProjectData" :
EmployeeID,Name ,Licence01,Lice nce02,Licence03 ...16
I've developed a nested updated/select query to update only the first Licence for each person (it's trivial to get all of them with slight variations on it):
The above successfully updates the first licence into the IDProjectData table, but the query prompts the user to enter in the CandidateNo for BOTH tables upon running it.
How do I restructure the query so that it just rolls over them all, updating the 'Licence01' column for each employee?
Or should I be going about this a different way?
I've got two tables, one that's full of data regularly externally updated called "tblEmployeeLic ences":
Code:
EmployeeID,Name,Licences 1001,Bill,Drivers 1001,Bill,Forklift 1002,Ted,Drivers 1002,Ted,Forklift 1002,Ted,Crane
EmployeeID,Name ,Licence01,Lice nce02,Licence03 ...16
I've developed a nested updated/select query to update only the first Licence for each person (it's trivial to get all of them with slight variations on it):
Code:
UPDATE IDProjectData RIGHT JOIN [SELECT TOP 1 Licences FROM tblEmployeeLicences WHERE EmployeeID = [IDProjectData].[EmployeeID] ]. AS Results ON IDProjectData.EmployeeID=Results.EmployeeID SET IDProjectData.IDWLicence01 = Results.Licences;
How do I restructure the query so that it just rolls over them all, updating the 'Licence01' column for each employee?
Or should I be going about this a different way?
Comment