Page 1 of 1

IIF expression

Posted: Mon May 22, 2006 5:08 pm
by David_Prince_(Guest)
I have recently started using R&R. I was used to using if then else formulas in crystal reports. How would i create an espression in R&R like the following:__if {cng01.cng01_typ} = 100 then "Customer Information" else__if {cng01.cng01_typ} = 200 then "Location Information" else__if {cng01.cng01_typ} = 300 then "Service Information" else__if {cng01.cng01_typ} = 400 then "Pricing Change" else__if {cng01.cng01_typ} = 500 then "Pricing Change" else__"Other"____I would very much appreciate your help.__thanks,

=> RE: IIF expression

Posted: Mon May 22, 2006 9:34 pm
by Rick_Johnson_(Guest)
While this can be done by__IIF(cng01.cng01.typ = 100, "Customer Information", __IIF(cng01.cng01.typ = 200, "Location Information",__IIF(cng01.cng01.typ = 300, "Service Information",__IIF(cng01.cng01.typ = 400, "Pricing Change",__IIF(cng01.cng01.typ = 500, "Pricing Change","Other)))))____Having said this, I personally would use the CASE statement. A little easier to construct and does the same thing. No need to keep up with the ")". (:-})____CASE(cng01.cng01.typ, 100, "Customer Information", 200, "Location Information", 300, "Service Information", 400, "Pricing Change", 500, "Pricing Change, "Other")____Either way, not too bad. God Luck. The CASE statement and the IIF are fully documented in the help files. ____note: A parenthesis is replaced by a smiley face in the post.

==> RE: IIF expression

Posted: Tue May 23, 2006 9:14 am
by David_Prince_(Guest)
Thanks very much for your help.