View Full Version : Stumped on Simple IIF Statement #Error


ptgraber
09-09-2007, 02:05 PM
Hi Folks -

I have a simple IIF statement that I am stumped on.

I have a report based on a query. I want to write some condtional lines based on results of the query. I have created a text box and in its control source I have placed:

=IIf([SPONSORSHIPS] > 0,"Number of Sponsorships",Null)

Why is this an error? [SPONSORSHIPS] is numeric in table def.:confused:

Thanks

_PTG

RuralGuy
09-09-2007, 02:35 PM
Have you tried:
=IIf([SPONSORSHIPS] > 0,"Number of Sponsorships","")

ptgraber
09-09-2007, 02:43 PM
I have tried that too. It seems that Sponsorships isn't a number. When I run isNumeric(), it returns false. But it is a number in the table.

-PTG

RuralGuy
09-09-2007, 02:51 PM
What is the Data Type for the field? Try:
=IIf(Nz([SPONSORSHIPS],0) > 0,"Number of Sponsorships","")

ptgraber
09-09-2007, 05:15 PM
I don't know what was happening, but seemed to have resolved it. Thanks for all your input!!

It won't do a greater-than check, but works with less than.

RuralGuy
09-10-2007, 06:33 AM
I believe your [SPONSORSHIPS] field is Null on occasion.