cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports: equivalent to '_'

former_member548403
Participant
0 Kudos

Hello, all gurus.

I have the following formula that I am trying to use in my report.

else if ({?Day_Night} ='Day') and ({?Position} = "Firefighter without specialty") 
then ({?Day_Night}={Command.Day}; 
{Command.pos_desc_ch} = "Firefighter" 
or {Command.pos_desc_ch} = "Firefighter (EMS)" 
or {Command.pos_desc_ch} like "Firefighter #_" 
or {Command.pos_desc_ch} like "Firefighter #__" 
or {Command.pos_desc_ch} like "Firefighter #__ (EMS)" 
) 

So far the report only returns values for the first two categories "Firefighter" and "Firefighter (EMS)". I know there are values for the other categories in the data, like 'Firefighter #1' or 'Firefighter #10' or 'Firefighter #11 (EMS)'.

I think it is '_' that is the problem right now. What is equivalent to '_' in the Crystal?

former_member548403
Participant
0 Kudos

Looks like this works!

else if ({?Day_Night} ='Day') and ({?Position} = "Firefighter without specialty") 
then ({?Day_Night}={Command.Day}; 
{Command.pos_desc_ch} = "Firefighter" 
or {Command.pos_desc_ch} = "Firefighter (EMS)" 
or {Command.pos_desc_ch} like "Firefighter #?" 
or {Command.pos_desc_ch} like "Firefighter #??" 
or {Command.pos_desc_ch} like "Firefighter #??(EMS)" 
) 

Accepted Solutions (0)

Answers (2)

Answers (2)

DellSC
Active Contributor

Since you're using a command, you should not be trying to filter the data in the Select Expert, which is what it looks like you're trying to do. See my blog post https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/ for information about how to filter data in commands - it should be done in the query itself.

If you're not using this to select data, you would probably do this to correct your formula :

else if ({?Day_Night} ='Day') and ({?Position} = "Firefighter without specialty")
then ({?Day_Night}={Command.Day} and
({Command.pos_desc_ch} = "Firefighter"
or {Command.pos_desc_ch} = "Firefighter (EMS)"
or {Command.pos_desc_ch} like "Firefighter #?"
or {Command.pos_desc_ch} like "Firefighter #??"
or {Command.pos_desc_ch} like "Firefighter #??(EMS)")
)

-Dell

abhilash_kumar
Active Contributor
0 Kudos

Hi Kenshin,

Is this part of the selection formula?

Could you please post the full code?

-Abhilash