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

Calculate expression and display total 1

Status
Not open for further replies.
Mar 14, 2002
711
US
(Access 97)

I am trying to multiply 2 fields in my Query and then somehow show the total in a separate field so I can use this number later, but I am completely unable to make this happen. I have 5 fields, 2 of which are numbers, so in the 6th field I typed in

"Total:[Std Qty]*[Qty]"

Now how can I display the "Total" so I know what the calculation is?

Thanks in advance,
 
Did you type it exactly as shown including the quotes? If you did then remove the quotes.
 
No error, just no results, it shows the expression as it is shown in the query designer...let me do that Golom, I will let you know. Thanks!
 
Excellent, that did the trick, no quotes:

i.e. Total:[Std Qty]*[Qty]

Thank you so much!
 
Ok, to take this a bit further, now I have the column showing my total, but what if I have several records of the same tool, in this case, I have 5 records for the same tool during the same day, and now I want to sum those 5 totals in a column so I can move the total rather than piece by piece, is there a way to do this, or do I have to transfer each individual record?

This is what I have for the expression:

Cycle Count: ([Std Pk Qty]*[Qty]/[Cav])

So then it shows me:

770
1284
450
362.5
450

What I want is one total of these 5 numbers, i.e.

3316.5

Thanks for any ideas!!
 
Your query will need to be something like
Code:
Select ToolID, SUM([Std Pk Qty]*[Qty]/[Cav]) As [Cycle Count]

From myTable

Group By ToolID
Where I've just invented a field called ToolID that is assumed to be the same for all instances of the same tool.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top