R
richietj77
Ok this is the situation.
I have these tables
tblEmployee
tblEmpDeductions (Employee Deductions)
with field EmployeeID as primary Key,
and these tables
tblPayroll
tblPayrollFile
with field PayrollID as primary Key.
On tblEmpDeductions, I have these fields:
EmployeeID - EmployeeDedID - EmployeeDedAmount
------------------------------------------------------
123-45-6789 - FICA - 123.45
123-45-6789 - Medicare - 67.89
On tblPayrollFile, I have these fields:
PayrollID - EmployeeID - GrossPay - TotalDeduc
------------------------------------------------------
2006-00 - 123-45-6789 - 500.00 - __________
I want to add the total of each Employee Deductions from
tblEmpDeductions to the field TotalDeduc in tblPayrollFile.
I've already tried with an update query but I received an error, I
think syntax is wrong:
DoCmd.RunSQL "UPDATE tblPayrollFile INNER JOIN tblEmpDeductions ON
(tblPayrollFile.EmployeeID = tblEmpDeductions.EmployeeID) SET
tblPayrollFile.TotalDeduc =
Sum([tblEmpDeductions].[EmployeeDedAmount])"
Please Help! Thanks.
I have these tables
tblEmployee
tblEmpDeductions (Employee Deductions)
with field EmployeeID as primary Key,
and these tables
tblPayroll
tblPayrollFile
with field PayrollID as primary Key.
On tblEmpDeductions, I have these fields:
EmployeeID - EmployeeDedID - EmployeeDedAmount
------------------------------------------------------
123-45-6789 - FICA - 123.45
123-45-6789 - Medicare - 67.89
On tblPayrollFile, I have these fields:
PayrollID - EmployeeID - GrossPay - TotalDeduc
------------------------------------------------------
2006-00 - 123-45-6789 - 500.00 - __________
I want to add the total of each Employee Deductions from
tblEmpDeductions to the field TotalDeduc in tblPayrollFile.
I've already tried with an update query but I received an error, I
think syntax is wrong:
DoCmd.RunSQL "UPDATE tblPayrollFile INNER JOIN tblEmpDeductions ON
(tblPayrollFile.EmployeeID = tblEmpDeductions.EmployeeID) SET
tblPayrollFile.TotalDeduc =
Sum([tblEmpDeductions].[EmployeeDedAmount])"
Please Help! Thanks.