Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Contains Formula Post Reply Post New Topic
Author Message
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Topic: Contains Formula
     Posted: 26 Jul 2010 at 2:05am
Hello,
 
Hopefully someone can help.
 
Is there a formula to search a string for a certain letter?
 
I am abit of a novice at the moment.
 
basically,
 
We have invoice numbers like: I3215481
 
our credit note numbers are: CR456481 or CDR168156
 
 
ALL credit notes contain the letter "R" in either the 2nd or 3rd position in the string.
 
what kind of formula / function would I need for this?
 
I have tried:
 
if {trnstk.invdate} in ["R"] then true
 
but it dont work.
 
 
all help greatly appreciated.
 
 
 
thanks
 
Regards,

Michael Jones
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 26 Jul 2010 at 2:23am
switch it around:
 
if 'R' in {trnstk.invdate} then true else false
|< /\ '][' ( )
IP IP Logged
Robotacha
Groupie
Groupie
Avatar

Joined: 11 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 97
Quote Robotacha Replybullet Posted: 26 Jul 2010 at 2:41am
LEGEND!! thankyou very much.

I did solve it myself just, using a longer method.

1st Formula:     instr({TRNSTK.INVNUM},"R",1)
2nd formula:     if formula1 = 0 then true

select expert: 2nd formula = False

 

thankyou for your help :)

Regards,

Michael Jones
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