Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: CASE with LIKE in CR Post Reply Post New Topic
Author Message
LiuxDj
Newbie
Newbie
Avatar

Joined: 10 Mar 2009
Location: Italy
Online Status: Offline
Posts: 23
Quote LiuxDj Replybullet Topic: CASE with LIKE in CR
     Posted: 04 May 2010 at 1:23am
Hi everyone...

do you know how can I use the LIKE operator with the CASE??

For example:

select {FIELD}
case LIKE '*asd*': global numberVar V1:=IntLab +1
case LIKE '*asd2*': global numberVar V2:=IntSite +1
case LIKE '*asd3*': global numberVar V3:=IntRem +1
case LIKE '*asd4*': global numberVar V4:=Tel +1;

This way to use LIKE doesn't works!

How can i do? (I would not like to use IF-ELSE)

Thanks for your help!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 May 2010 at 2:56am
instr(stingToBeSearched, findThis)... I'm not sure that this will work...I can't find SELECT like that...Switch() would be one option or IF-ELSE
 
if instr({FIELD}, "asd")> 0 then ...
 
you would want to check the asd4,3,2 first as they all are *asd*
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum