Dividing by calculated total sum of two query columns

shocktea

Registered User.
Local time
Today, 08:27
Joined
Aug 28, 2013
Messages
11
I currently have a query that pulls selected data from a table. There can be multiple rows of data, and two columns include dollar amounts and quantities. I have a total line going at the bottom so I can see the Grant Total of all the rows (for dollar amounts and quantity).

Is it possible to add a column to this query that will calculate the expression:..?
=Grand Total of Dollar Amts for selected data/Grand Total of Quantity for selected data

I tried to use a query in a query, but must have done something wrong because it just said circular reference.
 
Better done on a form.

Add textboxes to the header or footer for the grand totals with the control source
=[fieldname]

Then add another textbox to the header or footer with the ControlSource:
=totalbox1/totalbox2
 
For anyone who needs this in the future, I figured out how to do this in the query. I set the Total (sigma sign) as an Expression then entered:

BillingRate: [InvoiceSubtotal]/[QtyInvoiced]

Simple enough.
InvoiceSubtotal and QtyInvoiced were just titles of my other query/table columns that I needed to get the info from. It works perfectly! Hope this might help someone else.
 

Users who are viewing this thread

Back
Top Bottom