问题
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?
回答1:
({i_NonPfcIncDetStt.TeamCode} IN ['ABC','DEF']) perhaps?
回答2:
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.
来源:https://stackoverflow.com/questions/6788743/in-operator-in-crystal-report