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

How to Sum a column in a report based on the value of another column

Status
Not open for further replies.

flavor2008

IS-IT--Management
May 12, 2008
10
Hi,

I have values in a column of a report and I want to sum the values based on the value of another column. e.g

col col2
20 NGN
30 USD
40 USD
40 NGN

Summary
SUM (NGN) = 60
SUN (USD) = 70

Pls how can I achieve this in the MS access report
 
How about:

Sum(IIf(Col2="USD",Col,0))
 
Hi Remou,

Yes it worked, I have tested it on a test environment.

Thanks
 
As you asked in the JetSQL forum instead of the Access Reports forum, here the SQL answer:
SELECT Col2, Sum(Col1) As Total FROM yourTable GROUP BY Col2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top