Use LIKE operator for parameter

I need to use the operator likefor my parameter in Crystal Reports 2011. It should work for multiple accounts. How can I execute something like the following code?

if ({?test}) like ("*ABC" ,"*KBJ" ,"*CDE") then 1 else 0
+4
source share
1 answer

It seems that your code only needs lines that end with ABC, KBJ or CDE. So try the following:

(RIGHT({?test}, 3) = "ABC")
OR
(RIGHT({?test}, 3) = "KBJ")
OR
(RIGHT({?test}, 3) = "CDE")

It is also worth noting that IF yourConditionHere THEN 1 ELSE 0is redundant. Simplify it only yourConditionHereand it will return True or False.

0
source

Source: https://habr.com/ru/post/1656583/


All Articles