How to remove duplicated ID but have them add up the values the ID represneted (1 Viewer)

alcorp

Registered User.
Local time
Yesterday, 21:40
Joined
Jul 2, 2014
Messages
10
Hi,

In access I queried my results and now I have to do this last step. I basically have an ID column and a tax fee column. I am trying to remove the duplicated ID numbers but if they are duplicated I need it to add up the tax fee column so I can have one ID with all the tax fees added up together instead of several different ones.

I tried doing the equivalent to a pivot table (works perfectly in excel) but when I tried doing it in access, it did not work.

Is there any other way or steps on how to do this??
Thanks
 

plog

Banishment Pending
Local time
Yesterday, 23:40
Joined
May 11, 2011
Messages
11,646
You would use an aggregate query (click the Sigma/Summation symbol in the ribbon). That will put 'Group By' underneath all your fields listed in the bottom. Under the tax fee field, change it to 'Sum'.

Post back your SQL if you have any other issues.
 

alcorp

Registered User.
Local time
Yesterday, 21:40
Joined
Jul 2, 2014
Messages
10
You would use an aggregate query (click the Sigma/Summation symbol in the ribbon). That will put 'Group By' underneath all your fields listed in the bottom. Under the tax fee field, change it to 'Sum'.

Post back your SQL if you have any other issues.

Okay where is it? I clicked on my query results table to display the ID and the Taxfee columns. So I then click the create tab and I don't see Sigma/Summation symbol in the ribbon. (I looked at the other tabs and still nothing)
 

plog

Banishment Pending
Local time
Yesterday, 23:40
Joined
May 11, 2011
Messages
11,646
In design view of the query it is under the Query Tools option in the menu, under that is one that says 'Design'
 

alcorp

Registered User.
Local time
Yesterday, 21:40
Joined
Jul 2, 2014
Messages
10
In design view of the query it is under the Query Tools option in the menu, under that is one that says 'Design'

Okay awesome I found but I get this error when I run it. I left the ID column as Group by and I tried using other methods but still the same error.


"Data type in mismatch in criteria expression."

This is the SQL:
SELECT APN.APN, Sum(APN.TAXFEE) AS SumOfTAXFEE
FROM APN
GROUP BY APN.APN;
 

plog

Banishment Pending
Local time
Yesterday, 23:40
Joined
May 11, 2011
Messages
11,646
That means TAXFEE isn't a numeric field. You can't sum up text. Why is TAXFEE a text field?
 

alcorp

Registered User.
Local time
Yesterday, 21:40
Joined
Jul 2, 2014
Messages
10
That means TAXFEE isn't a numeric field. You can't sum up text. Why is TAXFEE a text field?

Oh whoops. Supposed to be a numeric. Let me try again.
 

Users who are viewing this thread

Top Bottom