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

Add a total Dollar amount Within a specific group

Status
Not open for further replies.

Comp2008

Technical User
Oct 8, 2008
32
US
Part of my Access Database has two fields that I want to work on: [Models] and [Gross]
[Models] has a drop down list with ( “A”, “B”, “C”, etc,) options. And the [Gross] field has Currency as a data type.
How can I get a breakdown of the total Gross of each individual model? An example of my Query looks something like this:

Model……………….Gross
A……………………….150.00
A……………………….200.00
B……………………….375.00
C……………………….400.00
C……………………….100.00

When I use this expression considering only Model “A”,
Code.
Abs(Sum(
.[Gross] And (
.[Model]="A"))) AS [Total A Gross]


I get the count of the number of records that the Model “A” has, which is 2. Instead, my intension is to get the total Gross amount of it, which is $350.00.

If anyone can help me on this, will be greatly appreciated
 
Select Model,sum(gross) as SumOfGross
From Tablename
Where model="A
 
Comp2008,
This is a reports forum yet I don't see anything in your question that suggests your problem involves a report. It isn't clear if you want/expect totals in your query or in a text box in a report section.

Duane
Hook'D on Access
MS Access MVP
 
So far so good, thank you. Now, what would it be if I want to get the Gross of Model “A” “B” and “C” in a query. Something like this would be the idea:

Model……Gross……Gross A……Gross B……Gross C
A…………150.00……..150……….…0……………..0
A………. 200.00………200………….0……………..0
B……….375.00………..0…………375……………..0
C……… 400.00………..0………….0……………..400
C………100.00………..0………….0……………..100


By the way, with the expression I sent before, the query looks like this:

Model……Gross……Gross A……Gross B……Gross C
A…………150.00……..1..……….…0……………..0
A………. 200.00………1..………….0……………..0
B……….375.00………..0…………1..……………..0
C……… 400.00………..0………….0……………...1
C………100.00………..0………….0……………....1

Thank you

Comp2008
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top