Crystal report like condition

*Search Term*. ( with both * at the begining and the end of the Term). But the user doesn't like typing '*', they awlays want to type search term directly.

However typing * or not typing * will return quite different set of records. With * , there are more hits than without *. Could anyone advise how to integrate * in the like above without typing * at the parameter prompt? thanks in advance. Not at work so can't test this but I think like ('*'++'*') should work or you can just use an instring function instr(ING_sub.HEAD>,,1)>0

the first option result in CR returning everything! I don't think it's searching the 'Term' typed in the parameter prompt.

the second option has an error "The array must be subscripted, e.g. Array " Please advise again, thank you.

Edited by johnwsun - 10 Sep 2009 at 7:58pm

You have the param set to allow multiple values? That messes both of these up. It gets into arrays which is not my forte but take a look at this. might help

No, it does not take multiple values; it only allows to search a term at a time as instructed to the user, e.g. *nursing* in my original approach, tt results returns well but the user doesn't like to type *.

I would double check that setting in the parameter.

I tested both processes and they both worked fine for me if the parmater was set with "Allow mutliple values"=False. When I changed that value to True both failed in the exact same way you described. The * process returned all not null records and the instr() choked on the array subscript.

If it is set to False, what are the other properties set to? Since my test of either approach worked I would think it would have to do with param properties being different than my test param.

Edited by DBlank - 12 Sep 2009 at 8:50am

thank you very much for pointing out. I was acutally doing 'allow multiple values ' but I gave up, and forgot to set that back to false. Yes, after using the first option you have advised, it works now.

However I will have to go back to check the user's specification whether it requires multiple values or not. But searching multiple terms in differnt subject areas would not make sense in this report. For exmaple, searching 'nursing' only want to find nursing related information. When searching 'nursing' and 'engineering' would not make sense. If they require multiple values even in one subject area, I think I will refer to the example in the link you advised earlier. Thank you very much for your help.

The user has to enter *term* in the parameter popup box, I'm afraid, after I have tried to use CR's join function without sucess.:

= join(, ', ' ) (without entering '*' with the searching terms.)

tthe formula from the link above you advised works the same way as the join function except adding some filtering(I don't need to filter searching terms).

The searching must allow multiple terms so I will keep the setting as True for Allow multiple values.

Originally posted by johnwsun

The user has to enter *term* in the parameter popup box, I'm afraid, �after I have tried to use CR's join function without sucess.:

�= join(,� ', ' ) (without entering '*' with the searching terms.)

tthe formula� from the link above you advised works the same way as the join function except adding some filtering(I don't need to filter searching terms).

The searching must allow multiple terms so I will keep the setting as True for Allow multiple values.

I just created a formula that took the parameter and appended stars to both sides. then i used that formula in the select expert.

the formula looked like this
'*' + + '*'