Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Wildcards in formulas Post Reply Post New Topic
Author Message
Woody
Newbie
Newbie
Avatar

Joined: 07 Mar 2007
Location: New Zealand
Online Status: Offline
Posts: 2
Quote Woody Replybullet Topic: Wildcards in formulas
    Posted: 07 Mar 2007 at 11:31am
I am fairly new to Crystal Reports, but have done a lot of work previously in Access.
 
My Query......I am writing an IF statement. I am looking into a field in the report, and if the text in that field matches my example, it writes something in a new field.
eg...
 
WhilePrintingRecords;
StringVar CONN;
 
if ({Piping.SHORT_DESC} = "PIPE")
    then (CONN := "BE")
    else if ({Piping.SHORT_DESC} = "WT")
    then (CONN := "BW")
    else if ({Piping.SHORT_DESC} = "WTR")
    then (CONN := "BW")
    else (CONN := "-")
 
To cut the code down I just want to capture all the items starting with W (WT & WTR) and assign them to BW.
Woody
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 07 Mar 2007 at 11:46am
To get the first letter of a string, you can use the code:
if Left({Piping.SHORT_DESC}, 1)="W"
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Woody
Newbie
Newbie
Avatar

Joined: 07 Mar 2007
Location: New Zealand
Online Status: Offline
Posts: 2
Quote Woody Replybullet Posted: 07 Mar 2007 at 11:51am
Awesome - Thanks
 
Sooooooooo easy when you know how Smile
Woody
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.027 seconds.