An IIf Question

lumpy2497

Registered User.
Local time
Yesterday, 23:04
Joined
Jun 10, 2003
Messages
17
Hi All... here is my quandry:

Here are the fields that pertain to this question-

Gas - currency, 2 decimal places
Electric - currency, 2 decimal places
Misc - currency, 2 decimal places
Budget - currency, 2 decimal places

I need to create an if-then-else with the IIf statement, and for some reason, it is not working (I keep getting a comma error). The jist of the statement reads like this:

If Budget = 0
Then Gas + Electric + Misc
Else Misc + Budget


I know the solution is so simple, but getting it to work is the hard part.

Any help is greatly appreciated!!

Leeann... :)
 
I would recommed useing the builder to ensure that you have the proper spellings for the refrenced fields, and that everythign is properly bracketed and puncuated.

Iff([tbl_1].[Budget] <=0, VARIBLE = [Then Gas] + [Electric] + [Misc], VARIBLE = [Misc] + [Budget])

The syntax is Iff(CONDITION, If True do this, If False do this)

The true and false are seperated only by a comma.
 
Thanks!!

Thanx for the help!!!!

Leeann... :) :) :)
 
Continued...

How would I put that expression into a report footer so that I have a total sum of those values? One caveat is that I would only need the values that are greater than 0.

Leeann... :)
 

Users who are viewing this thread

Back
Top Bottom