Sum a field then minus

aron.ridgway

Registered User.
Local time
Today, 14:37
Joined
Apr 1, 2014
Messages
148
Im trying to sum a qty field naming it 'TotalRecieve' and then minus a qty from that sum?

i've tried the following
Code:
RemainingQty: Sum([tblReceiveDetail].[QTY])-[tblOrderDetail].[Qty]

but i get an error saying 'Your query does not include the specified expression as part of an aggregate function?

any pointers?
 
This method might be very slow, but you could try,
Code:
RemainingQty: DSum("QTY", "tblReceiveDetail")-[tblOrderDetail].[Qty]
 
i managed to sort it with the following, seems to be working ok!

Code:
RemainingQty: Avg([tblOrderDetail].[Qty])-Sum([tblReceiveDetail].[QTY])
 

Users who are viewing this thread

Back
Top Bottom