Page 1 of 1

Problem generating expression

Posted: Mon Aug 20, 2012 9:56 am
by Nicolai_Petrov
Hello,

I'm triying to make the logic for evaluating a database field and depending if the value is 0,1,2,3 or 4 assign to the text label the value of variable1, variable2, variable3, variable4 or variable5 respectively.

The code i'm triying in vb.net is:

IIF {Cabecera.TDoc} = 0,{Variable1},IIF {Cabecera.TDoc} = 1,{Variable2},IIF {Cabecera.TDoc} = 2,{Variable3},IIF {Cabecera.TDoc} = 3,{Variable4},IIF {Cabecera.TDoc} = 4,{Variable5},'Error'

I know this is not correct, could you tell me what i'm missing?

Thanks,

Nico.

Re: Problem generating expression

Posted: Tue Aug 21, 2012 6:03 am
by HighAley
Hello.
Nicolai_Petrov wrote:I'm triying to make the logic for evaluating a database field and depending if the value is 0,1,2,3 or 4 assign to the text label the value of variable1, variable2, variable3, variable4 or variable5 respectively.

The code i'm triying in vb.net is:

IIF {Cabecera.TDoc} = 0,{Variable1},IIF {Cabecera.TDoc} = 1,{Variable2},IIF {Cabecera.TDoc} = 2,{Variable3},IIF {Cabecera.TDoc} = 3,{Variable4},IIF {Cabecera.TDoc} = 4,{Variable5},'Error'

I know this is not correct, could you tell me what i'm missing?
You should use Choose (index, choice1, choice2, ...) function or if you have complex condition use Switch (condition1, value1, condition2, value2, ...)
You could find description of these functions in our documentation.

Thank you.