K
Kristine Nguyen
Hi,
I have an append query to calculate the weekly totals and taxes which would
do the job for me, however, since Access does not round correctly, I need to
go through each record to calculate and use my own rounding function and
insert into the payh table. Here's the query:
INSERT INTO payh ( emp_id, week_ending, gross, ss, med, net_pay )
SELECT [payd].[emp_id] , [payd].[week_ending] AS Expr2, Sum([payd].[total])
AS gross, round(([gross]*0.062),2) AS ss, round(([gross]*0.0145),2) AS med,
([gross]-[ss]-[med]) AS net_pay
FROM payd
WHERE (([payd].[create_payh_flg])='N'))
GROUP BY [payd].[emp_id], [payd].[week_ending]
Because the round function in Access does not round correctly (round .5 up),
I would need to go through each of the sum of amount above to calculate the
ss, med, & net_pay fields. The question is, how do I accomplish the same
thing above by going through each records? I'm not very familiar with VBA
records. Help is appreciated.
Thanks,
Kristine
I have an append query to calculate the weekly totals and taxes which would
do the job for me, however, since Access does not round correctly, I need to
go through each record to calculate and use my own rounding function and
insert into the payh table. Here's the query:
INSERT INTO payh ( emp_id, week_ending, gross, ss, med, net_pay )
SELECT [payd].[emp_id] , [payd].[week_ending] AS Expr2, Sum([payd].[total])
AS gross, round(([gross]*0.062),2) AS ss, round(([gross]*0.0145),2) AS med,
([gross]-[ss]-[med]) AS net_pay
FROM payd
WHERE (([payd].[create_payh_flg])='N'))
GROUP BY [payd].[emp_id], [payd].[week_ending]
Because the round function in Access does not round correctly (round .5 up),
I would need to go through each of the sum of amount above to calculate the
ss, med, & net_pay fields. The question is, how do I accomplish the same
thing above by going through each records? I'm not very familiar with VBA
records. Help is appreciated.
Thanks,
Kristine