cancel
Showing results for 
Search instead for 
Did you mean: 

Like Operator

Former Member
0 Kudos

Hi All,

I need to check the below condition to suppress a section.

My query is like this

SELECT scan_mode,STATUS,transaction_no FROM gfi_transaction WHERE transaction_id={?TID}

If transaction no starts with GR then i need to hide a particular section.The value for transaction no is GR_9

I wrote condition like this

transaction_no like "G?" but not working .

Please suggest.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

The formula should be:

transaction_no LIKE "GR*"

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Can you please tell why "G?" is not working ?

abhilash_kumar
Active Contributor
0 Kudos

That's because '?' stands for a single character whereas '*' stands for any number of characters.

So, 'G?' will be True only when the value is 'GO' or 'GT' etc.

'G*' will be True for longer words that start with G.

-Abhilash

Answers (2)

Answers (2)

priyaranjan_gupta
Participant
0 Kudos

If transaction no starts with GR then i need to hide a particular section.The value for transaction no is GR_9

I wrote condition like this 

transaction_no like "G?" but not working .

Transaction_no like 'GR%' should work in this scenario.

and also rememnber that value given is case sensitive.

Regards,

Priyaranjan

abhilash_kumar
Active Contributor
0 Kudos

Thanks Priyaranjan, however '%' is Not a recognized wildcard symbol (with the LIKE operator) in Crystal Reports.

You have to use either '?' or '*' with the Like operator in Crystal Reports.

-Abhilash

priyaranjan_gupta
Participant
0 Kudos

Hi ,

TRY with 'GR%'.

Regards,

Priyaranjan