Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: If then formula Post Reply Post New Topic
Author Message
stevetothink
Newbie
Newbie


Joined: 18 Oct 2010
Online Status: Offline
Posts: 37
Quote stevetothink Replybullet Topic: If then formula
    Posted: 18 Oct 2010 at 8:57am
Hi Folks,
 
I have a database field such as PA12345 and I want to write an if then formula that says "if the first 2 letters of this field equal "PA" then display $21.12."
 
Is it possible to have the formula only look at the first 2 letters of the data for an if/then statement?

Thanks in advance.
 
Steve
IP IP Logged
rybad80
Newbie
Newbie
Avatar

Joined: 18 Oct 2010
Location: United States
Online Status: Offline
Posts: 7
Quote rybad80 Replybullet Posted: 19 Oct 2010 at 5:59am
You can use the  startswith command.
 
If {table.database} startswith "PA"
Then "$21.12"
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.016 seconds.