Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: CRYSTAL IF STATEMENT HELP PLEASE Post Reply Post New Topic
Author Message
andyme
Newbie
Newbie
Avatar

Joined: 19 Feb 2010
Location: United Kingdom
Online Status: Offline
Posts: 15
Quote andyme Replybullet Topic: CRYSTAL IF STATEMENT HELP PLEASE
    Posted: 19 Feb 2010 at 9:08am
Hi all,

Any help here would be greatfully appreciated, I just need a IF statement writing where if a ID's number of characters = 5 then add the letter "A" to the of the ID.

IF (Length (ID) = 5) Then (ID)+"A"


I have done If statements in Excel and Visual basic, but never crystal and im struggling.

Hope You can Help.

Thanks
Andy
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Feb 2010 at 9:39am

Assuming the ID field is a string

IF Length({table.ID}) = 5 Then {table.ID}+"A" else ... 
IP IP Logged
andyme
Newbie
Newbie
Avatar

Joined: 19 Feb 2010
Location: United Kingdom
Online Status: Offline
Posts: 15
Quote andyme Replybullet Posted: 22 Feb 2010 at 1:28am
the field is a number. is there anyway of still doing the if statement?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Feb 2010 at 7:17am
If Length(totext({table.ID},0,'')) = 5 Then totext({table.ID},0,'')+'A'
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.031 seconds.