Dsum need 2 fields in calc

penwood

Registered User.
Local time
Today, 04:23
Joined
Nov 26, 2005
Messages
51
Dsum need 1 field inside divisor calc

I have a Qry field:

TotalUsage: Val((Round(Nz([UomUsage])/DSum("Nz([UomUsage])","[tblDetail]",),4)*100))

the problem is that the DSUM needs to sum up all the like records using the same SubID. I need some extra code in the divisor part. EG

subID uomUsage TotalUsage
33 10 100
33 40 100
33 50 100

34 43 100
34 57 100

the dsum needs to use SubID in order to sum correcly EG on SubID 33 as 100 uomUsage.
SubID is a Number field, Long integer.


I am presently getting wrong info. the formula above Dsum is summing as 200 since i eroneously don't have Subid in the Qry calc.

How can i fix? Thanks

Penwood
 
Last edited:
I figured it out. Here is the solution if someone wants it. Or if someone has anything better. but this will do.

TotalUsage: Val((Round(Nz([UomUsage])/DSum("Nz([UomUsage])","[tblDetail]","[SubID] = " & [SubID] & " "),4)*100))

P
 

Users who are viewing this thread

Back
Top Bottom