Sum specific row values

  • Thread starter Thread starter ApeX
  • Start date Start date
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!
 
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
..
 
Back
Top