Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

How to combine multiple lines by a sum function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
cxw - 22 Apr 2008 19:01 GMT
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
KARL DEWEY - 22 Apr 2008 20:13 GMT
SELECT [claim#],   Sum([losses]) AS [Claim Losses]
FROM YourTable
Group BY [claim#];

Signature

KARL DEWEY
Build a little - Test a little

> Hi,
>
[quoted text clipped - 11 lines]
> I need to find out how combine the claim numbers in my query and also add up
> the losses.  If that's possible
CJ - 22 Apr 2008 20:20 GMT
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!
Signature


CJ
---------------------------------------------------------
Know thyself, know thy limits....know thy newsgroups!

> Hi,
>
[quoted text clipped - 13 lines]
> up
> the losses.  If that's possible
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.