# Thread: Calculate sum of separate data in a record

1. Registered User
Join Date
Dec 2004
Posts
2

## Unanswered: Calculate sum of separate data in a record

I am designing a report that does the following:

Sorts on Job #, then Part # and under that part number it lists lot numbers. Each lot number has scrap as M.S. or F.S.

I have separated each F.S. or M.S. as follows

IIF([type]="F.S.",[SumOfQty],"") or IIF([type]="M.S.",[SumOfQty],"")

This puts the numbers in the correct columns on the report.

My problem is then doing a sum on each column (F.S. and M.S.) for each lot number.

I can get a total sum, however, I'd like to break it out F.S. and M.S.

Any help would be greatly appreciated.

Thank you,
Sandy

2. Registered User
Join Date
Jul 2004
Location
Southampton, UK
Posts
368
Hi
You can't actually sum up objects you create on the form afaik. You can only sum the underlying data. But there are a couple of ways you can do what you are asking (if I understand correctly what you are asking !)

Method 1
Assuming your report is based on a query, create two new columns in your query for F.S. Qty and M.S. Qty (using the formulas you've already got).

Add the two new columns to your report and you can sum as you would do normally.

Method 2.
In the footer (or wherever you are summing) add a text box with the control source as something like
=Sum(IIf([type]="F.S.",[SumOfQty],0))

...and another text box for "M.S."

hth
Chris

3. Registered User
Join Date
Mar 2004
Posts
51
Just to add to this. In my experience, I have found that second method to be the better way to go depending on what you are wanting to do in the end. It's very affective and straight forward.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•