G
Guest
I have created an update query to sum a value created in a select query to a value stored in a table. I need the value to be stored as a decimal number with 2 decimal places in the table. The select query creates the correct value (in two decimal places) however when the update query updates the field in the table the value is rounded to the nearest whole number. Whatever I try i cannot stop it doing this. I have modifed all the decimal place properties for the table, the select query and the update query I can find to no avail. The SQL for both the qeuries is attached at the end of this message - hope somebody can help
Select Query
SELECT Employees.EmployeeID, Employees.EmployeeName, tblWeekDates.WeekNo, tblWeekDates.WeekEndingDate, tblWeekDates.WeekCommencingDate, Employees.EmploymentStatus, DateDiff("d",Date()-28,Date()) AS Expr1, Employees.AverageWorkedDays, IIf([AverageWorkedDays]=5,([Expr1]/7)*0.38,(IIf([AverageWorkedDays]=4,([Expr1]/7)*0.31,(IIf([AverageWorkedDays]=3,([Expr1]/7)*0.23,(IIf([AverageWorkedDays]=2,([Expr1]/7)*0.15,(IIf([AverageWorkedDays]=1,([Expr1]/7)*0.08,0))))))))) AS Expr
FROM tblWeekDates, Employees INNER JOIN tblEntitlements ON Employees.EmployeeID = tblEntitlements.EmployeeI
WHERE (((tblWeekDates.WeekNo)=1) AND ((Employees.EmploymentStatus)="Currently Employed" Or (Employees.EmploymentStatus)="MaternityLeave"))
Update Query
UPDATE tblEntitlements INNER JOIN qryAccrual ON tblEntitlements.EmployeeID = qryAccrual.EmployeeID SET tblEntitlements.PermanentAccrual = [PermanentAccrual]+[Expr2]
Select Query
SELECT Employees.EmployeeID, Employees.EmployeeName, tblWeekDates.WeekNo, tblWeekDates.WeekEndingDate, tblWeekDates.WeekCommencingDate, Employees.EmploymentStatus, DateDiff("d",Date()-28,Date()) AS Expr1, Employees.AverageWorkedDays, IIf([AverageWorkedDays]=5,([Expr1]/7)*0.38,(IIf([AverageWorkedDays]=4,([Expr1]/7)*0.31,(IIf([AverageWorkedDays]=3,([Expr1]/7)*0.23,(IIf([AverageWorkedDays]=2,([Expr1]/7)*0.15,(IIf([AverageWorkedDays]=1,([Expr1]/7)*0.08,0))))))))) AS Expr
FROM tblWeekDates, Employees INNER JOIN tblEntitlements ON Employees.EmployeeID = tblEntitlements.EmployeeI
WHERE (((tblWeekDates.WeekNo)=1) AND ((Employees.EmploymentStatus)="Currently Employed" Or (Employees.EmploymentStatus)="MaternityLeave"))
Update Query
UPDATE tblEntitlements INNER JOIN qryAccrual ON tblEntitlements.EmployeeID = qryAccrual.EmployeeID SET tblEntitlements.PermanentAccrual = [PermanentAccrual]+[Expr2]