Sum specific row values

A

ApeX

Hi there, i have a problem trying to sum some values that are in
certain rows...The table looks like

Col1 Col2 Col3 Col4
-----------------------------------
P X 112 a
P X 100 b
P X 26 c
P X 15 b
P X 13 d
P X 10 a


Ok, the result must be a table that looks like

Col1 Col2 Col3 Col4
-----------------------------------
P X 122 a
P X 115 b
P X 26 c
P X 13 d

Please help...i need an sql query, if possible...

THANX!
 
J

John Spencer

SELECT Col1, Col2, Sum(Col3) as SumCol3, Col4
FROM YourTable
GROUP BY Col1, Col2, Col4

In the query grid
-- Add all 4 columns to the query
-- Select View: Total from the menu
-- Change Group By to Sum under Col3

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top