Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Duplicate from SUM

Status
Not open for further replies.

DBAFrog

Programmer
Sep 26, 2002
61
US
I have a query that pulls the Local and School tax from a payroll check, ie: wage = 1000.00 , local = 2.50, School = 2.00
Now when I rollup the group totals I get SUM of Wage = 2000.00 and SUM of PayDeductions = 4.50.

The Taxes are calculated correctly, but I have doubled the Wages ~ because the tax is calculated on the wage twice.

How can I remove the duplicate wage entry to rollup my report?

The bad news is that the local and school identifiers are all unique to the locality, so I can't just pull them from the PayDeductions tbl.

TIA

------------------
Curious by Nature,
Linux by Design
 
Hi, Perhaps adding a grouping on Wage and summing the deductions on that group.

Do not know if the business need would then be met, but it will eliminate the doubling of the wage

[profile]
 
Thanks, I had done that. But I think I have the answer. The overlap of school dist. is causing a problem that I didn't see at first.


------------------
Curious by Nature,
Linux by Design
 
For the wage summary, you could use a running total that evaluates on change of payroll check (whatever field is unique to the check).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top