PeterConnick
Programmer
Nesting an IF STATEMENT in Crystal Reports
Example
Category = (1,2,3,4)
I need to group these groups by
1
2
123
1234
How would a write an if statement to handle this
If Category = 1 then
“1”
else if Category = 2 then
“2”
else if Category = 1 or Category = 2 or Category = 3 then
“123”
else if Category = 1 or Category = 2 or Category = 3 or Category = 4 then
“1234”
else
“Not a valid Group”
The problem that I am running into is that category 1 never ends up in the 3rd or 4th condition.
Example
Category = (1,2,3,4)
I need to group these groups by
1
2
123
1234
How would a write an if statement to handle this
If Category = 1 then
“1”
else if Category = 2 then
“2”
else if Category = 1 or Category = 2 or Category = 3 then
“123”
else if Category = 1 or Category = 2 or Category = 3 or Category = 4 then
“1234”
else
“Not a valid Group”
The problem that I am running into is that category 1 never ends up in the 3rd or 4th condition.