Calculating Factorised Costs on a form

IainG

Registered User.
Local time
Today, 00:35
Joined
May 6, 2009
Messages
25
Hi,

Can anyone tell me how to resolve the following in Access2007?

I want to calculate [TotalCost] and it should be calculated on
[Quantity](If >0) or [Days](If>0) which ever one is input! * [UnitPrice].

Then I want this number factored up using any or all of 3 Factor fields but only if they not Null.

Hope this makes sense.

Thanks

Iain.
 
Have you tried using an IIF, Iain??
 
I have tried the following but if one of the Factor fields are Null then it won't calculate!
=IIf([Days]>0,IIf([Factor]>0 Or [Contingency]>0 Or [Growth]>0,([days]+([Factor]*[Days])+([Contingency]*[Days])+([Growth]*[Days]))*[UnitPrice]))
 
Use the NZ() Function so that you can replace a Null with 0

Example

NZ([Data Item,0)

You expression would be something like

=IIf(NZ([Days],0)>0,IIF(NZ([Factor],0)>0..........................................


HTH
 

Users who are viewing this thread

Back
Top Bottom