if or query giving negative result

colenzo

Registered User.
Local time
Today, 14:43
Joined
Jun 2, 2010
Messages
42
Hi guys,

I'm a bit of a novice at this so bare with me.

I've written a little expression for converting a number to text for a report.

There's two stages to this, I want the 1 to be converted to "PUBLIC" and the 2 to "NON PUBLIC". If i test these two separately, they work fine, but if I join them with an OR, for some reason, i'm getting a result of -1, which makes no sense at all.

could someone point out the obvious error in what i'm doing, as I really don't have a clue!

Code:
expTYPE1: (IIf([chrTYP]="1","PUBLIC",[chrTYP])) Or (IIf([chrTYP]="2","NON PUBLIC",[chrTYP]))
 
I would have just done

expTYPE1: IIf([chrTYP]="1","PUBLIC",IIf([chrTYP]="2","NON PUBLIC",[chrTYP]))

or if "1" and "2" are the only values, I assume they are text numbers and that's why the "s, then

expTYPE1: IIf([chrTYP]="1","PUBLIC","NON PUBLIC")

Brian
 
yep, that would make much more sense!

curse the dodgy CAB on the wall thats making all the noise and sending me doolally!

thank you muchly for the help!
 

Users who are viewing this thread

Back
Top Bottom