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

Using a Total Sum Value in an Expression in the Same Query

Status
Not open for further replies.

Gregshah

Technical User
Dec 28, 2007
8
US
I am using a query to add together numerous values for a total. I would like to take this total number and subtract it from another constant value in a related table. I want to calulate a balance of weight to ship by taking the full shipment weight minus the sum of the individual shipments. I can get the sum but how can I write the expression to subtract it from the full shipment weight?

Do I have to make another query? I hope not.

Thanks,
 

If your first sum is:
=Field1 + Field2

How about:
= Constant - (Field1 + Field2)


Randy
 
I did not explain myself correctly. I have a value called [actual weight] that is specific to a job. I have a second table that records each shipment weight for the job. There may be several shipments for a single job. I want to total the shipment weights and subtract the shipped weight from the original actual weight to see how much is left to ship. I can easily total the shipment weight but I do not know how to subtract this total from the actual in the same query.
 

I can easily total the shipment weight
What formula do you use to obtain the shipment weight?

HowMuchIsLeft = OriginalActualWeight -
(FormulaUsedToObtainShipmentWeight)



Randy
 
Thanks Randy. I just needed to play with the formating of the formula.

It works fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top