Question on calulation in a query (1 Viewer)

spet

Registered User.
Local time
Today, 06:55
Joined
Oct 5, 2018
Messages
38
Good Morning All,


I'm trying to figure out how someone calculated a field in a query I am working with and I am confused. Here is the calculation:


SCCAmt: Sum(IIf(SCCPremium([SCC],[Bacteria])>0,SCCPremium([SCC],[Bacteria])*[sumOfLbs]*0.01))


I'm especially not understanding this part: SCCPremium([SCC],[Bacteria]). Are they trying to find the total value of these two fields and assign it to a new field SCCPremium?


I believe this code was written in a very old Access version, but I can't find this online anywhere. Any help would be greatly appreciated.


Thank you in advance!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:55
Joined
Aug 30, 2003
Messages
36,118
SCCPremium is a public function in a standard module. It accepts those 2 fields as inputs and returns a value. You'd have to find it and see what it does. Ctrl-F in the VBA editor should help you do that.
 

spet

Registered User.
Local time
Today, 06:55
Joined
Oct 5, 2018
Messages
38
Thank you pbaldy! Makes complete sense now that I found the module holding that public function.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:55
Joined
Aug 30, 2003
Messages
36,118
Happy to help!
 

Users who are viewing this thread

Top Bottom