A
Ann Scharpf
I am trying to do an update query. I have a payroll table that has pertinent
dates, an annual salary etc. I have a standard variables table that has info
like the cost of living allowance increase. (US fed employees, so I have to
calculate the salary for Oct - Dec, then apply the COLA for Jan - Sep.)
If I create a make table query, my formulas work fine and calculate the
proper salary amounts for each part of the year. But, if I try to make this
an update table, my datasheet view shows the calculated field names but all
the values are null.
Here is the SQL view of my query. I'd greatly appreciate any help you can
give me.
UPDATE StandardVariables, [Civilian Payroll - Update Test Version] SET
[Civilian Payroll - Update Test Version].CY1Salary =
DateDiff("d",[FYStart],[CY1End])/365*[Salary], [Civilian Payroll - Update
Test Version].CY2Salary = DateDiff("d",[CY2Start],[FYEnd])/365*[Salary],
[Civilian Payroll - Update Test Version].BenefitsCost =
([CY1Salary]+[CY2Salary])*[BenefitsPercent]
WHERE ((([Civilian Payroll - Update Test Version].CY1Salary) Is Null) AND
(([Civilian Payroll - Update Test Version].CY2Salary) Is Null) AND
(([Civilian Payroll - Update Test Version].BenefitsCost) Is Null) AND
(([CY1Salary]+[CY2Salary]+[BenefitsCost]+[Bonus]) Is Null));
dates, an annual salary etc. I have a standard variables table that has info
like the cost of living allowance increase. (US fed employees, so I have to
calculate the salary for Oct - Dec, then apply the COLA for Jan - Sep.)
If I create a make table query, my formulas work fine and calculate the
proper salary amounts for each part of the year. But, if I try to make this
an update table, my datasheet view shows the calculated field names but all
the values are null.
Here is the SQL view of my query. I'd greatly appreciate any help you can
give me.
UPDATE StandardVariables, [Civilian Payroll - Update Test Version] SET
[Civilian Payroll - Update Test Version].CY1Salary =
DateDiff("d",[FYStart],[CY1End])/365*[Salary], [Civilian Payroll - Update
Test Version].CY2Salary = DateDiff("d",[CY2Start],[FYEnd])/365*[Salary],
[Civilian Payroll - Update Test Version].BenefitsCost =
([CY1Salary]+[CY2Salary])*[BenefitsPercent]
WHERE ((([Civilian Payroll - Update Test Version].CY1Salary) Is Null) AND
(([Civilian Payroll - Update Test Version].CY2Salary) Is Null) AND
(([Civilian Payroll - Update Test Version].BenefitsCost) Is Null) AND
(([CY1Salary]+[CY2Salary]+[BenefitsCost]+[Bonus]) Is Null));