Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IN operator in Crystal Report

I was trying to filter the crystal report by using the IN operator like what we do in SQL. In crystal report, i was trying to do it the same way as something like this ({i_NonPfcIncDetStt.TeamCode} IN ('ABC','DEF')) but it's giving me error, "The ) is mising".

Any idea how can i do this in crystal report?

like image 470
Fire Hand Avatar asked Jul 22 '11 10:07

Fire Hand


People also ask

How do you write not equal to in Crystal Report?

The comparison operators are equal (=), not equal (<>), less than (<), less than or equal (<=), greater than (>) and greater than or equal (>=).


2 Answers

({i_NonPfcIncDetStt.TeamCode} IN ['ABC','DEF']) perhaps?
like image 110
Arvo Avatar answered Nov 15 '22 22:11

Arvo


Yep, use the brackets not parens.

For fancy, you can put the to-match strings in a delimited string variable, and then use SPLIT.

@toMatchList
"ABC,DEF,MDV,HLV,ILY,TLA,OMG,LOL,GOD,ETC"

({i_NonPfcIncDetStt.TeamCode} in Split(@toMatchList, ","))

For extra-fancy, you can do pattern matching.

like image 45
Marc Avatar answered Nov 15 '22 22:11

Marc