Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Removing last char if alphabetic Post Reply Post New Topic
Author Message
Kaiser
Newbie
Newbie


Joined: 28 Feb 2012
Online Status: Offline
Posts: 11
Quote Kaiser Replybullet Topic: Removing last char if alphabetic
     Posted: 12 Jul 2012 at 4:21am
Apologies if this has been dealt with already, I cannot find it.
 
Number recorded in field is either of format 12345 or 12345N
 
I need a formula that will remove the final character from the string if it is a letter.
 
Thanks in advance
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 12 Jul 2012 at 5:55am
if numerictext({string_field}) then  {string_field} else left({string_field}, len({string_field})-1)

I believe this should work (if I got the parans balanced).  It also assumes that there are no other non-numeric characters in the string.
IP IP Logged
Kaiser
Newbie
Newbie


Joined: 28 Feb 2012
Online Status: Offline
Posts: 11
Quote Kaiser Replybullet Posted: 12 Jul 2012 at 6:12am
Thanks kevlray, that appears to work alright, much obliged!
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