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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum of numbers in same table 2

Status
Not open for further replies.

Allilue

Technical User
Sep 14, 2000
189
GB
I have a table which contains 2 columns. The first column is a 4 digit number which may have duplicates. The second column is also a number which represents a count. I would like to take the duplicates in the first column and sum the second columns for which there are duplicates. For example:

Column1 Column2
0000 52
0001 10
0001 8
0002 41
0003 55

I want it to find that 0001 has a duplicate and to add the numbers in the second column (10+8) so that the resulting table is this:

Column1 Column2
0000 52
0001 18
0002 41
0003 55

I can only think of really long and manual ways to do this. Is there something easier?

Thanks!

 
use a query with the Totals turned on (Click on the funny looking E on the toolbar). Set Column 1 Total to Group by and Colum 2 Total to Sum. Ensure Column 2 is numeric, and if not use Val(Column 2) instead.

PaulF
 
.....Thanks.

Sounds too easy now that I think of it.

Thanks Again!
Allison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top