IIF Function

  • Thread starter Thread starter CC
  • Start date Start date
C

CC

Hello I need some assistance with a calcualtion.
If Sent to CA is equal to zero then return what ever is in
the Weekly # Entered field if false then subtract Sent to
CA from Weekly # Entered.


Weekly Entered #: IIf([Sent to CA]=0,[Weekly#Entered],
[Weekly#Entered]-[Sent to CA])

The problem is that it is not returning the Weekly#Entered
field - and the field is populated. CC
 
CC said:
Hello I need some assistance with a calcualtion.
If Sent to CA is equal to zero then return what ever is in
the Weekly # Entered field if false then subtract Sent to
CA from Weekly # Entered.


Weekly Entered #: IIf([Sent to CA]=0,[Weekly#Entered],
[Weekly#Entered]-[Sent to CA])

The problem is that it is not returning the Weekly#Entered
field - and the field is populated. CC

Are you sure that [Sent to CA] is zero and not null?

If [Sent to CA] is always a number (sometimes zero) then you don't even
need the IIf(). Just subtract the zero from [Weekly#Entered] and you get
the same results.
 
You have to watch the data type issue here. I have done
soemthing very similar here:

=IIf(([YrM1Pts]<>""),Str((CInt([YrM1Pts])+CInt
([Points]))/2),"")

The first part of yours might need to be:

IIf([Sent to CA]="0"

Hope that helps,

Mark
 
Back
Top