How to combine multiple lines by a sum function

C

cxw

Hi,

I work for an insurance co and I have duplicate data from a query by claim
number. I need a way to combine losses by claim number based on that claim
number. ex:

claim# losses
400 $500
400 $800
401 $0
401 $300
401 $800

I need to find out how combine the claim numbers in my query and also add up
the losses. If that's possible
 
K

KARL DEWEY

SELECT [claim#], Sum([losses]) AS [Claim Losses]
FROM YourTable
Group BY [claim#];
 
C

CJ

Hi

You need to make your query a Total query.......really simple.

In the query design, click on the Totals button (It looks like AutoSum from
Excel, or the Greek Sigma symbol).

You will notice that you have an extra Total row down in the grid of your
query, below the field names. Each item in the Total row says "Group By".
Keep Group By for the Claim Number field, change it in the Losses field to
say Sum.

That should do it!
 

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