# Adding totals for items in each code

G

#### Guest

My brain has short circuited for today and I can't think. Any help would be
much appreciated.
I want to create a query (i guess) to:
1) multiply 1 column w/another giving me a total for each ITEM (I.e.
QTYxCOST/UNIT)
2) add totals for each ITEM by CODE group

I was able to create a query for task #1. I'm just stuck on #2

SAMPLE OF DATA TABLE
CODE SUBCODE ACTIVITY DESCRIPTION QTY UNIT COST/UNIT
1000 GENERAL REQ.
1000 001 Superintendant 320 HR \$60.00
1000 002 Project Manager 103 HR \$50.00
2000 DEMOLITION.
2000 001 1st fl trash removal 12 HR \$50.00

J

#### Jeff L

Is this what you want?

Select Code, Sum(Qty*[Cost/Unit])
From MyTable
Group By Code

G

#### Guest

Thanks Jeff for your prompt response. For some reason, the formula wasn't
accepted. I know I'm doing something wrong because your formula makes TOTAL
sense. Let me back track my steps.
I created a report using Report Wizard, pulling from a table. I asked it to
list all my activities and group by CODES. I used STEPPED for my layout
option. I selected MODIFY REPORT DESIGN. I created another box and asked it
to calculate the total for each item by using the following formula:
=[QTY1]*[COST/UNIT1]
I created another box and called it BUDGET \$. I tried to enter your formula
into the CONTROL SOURCE. But nothing came up. Did I goof up again?

Jeff L said:
Is this what you want?

Select Code, Sum(Qty*[Cost/Unit])
From MyTable
Group By Code

J

#### Jeff L

Try this:
The first Textbox you created (with =[QTY1]*[COST/UNIT1] ), I'm going
to call Amount. Now in the Budget textbox put
=[Amount]. Look at the properties for Budget and click on Data, change
Running Sum to Over Group. That will give you the Sum of
[QTY1]*[COST/UNIT1] for each group.