Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula to display left text only Post Reply Post New Topic
Author Message
amcapfixtures
Newbie
Newbie


Joined: 30 Sep 2020
Location: United States
Online Status: Offline
Posts: 2
Quote amcapfixtures Replybullet Topic: Formula to display left text only
    Posted: 30 Sep 2020 at 8:43am
Hi all, new to the forum. I'm using Crystal Reports 2013. I have a text string where I only want the left characters reported before the space between it and the remaining data. i.e. Carters 903216 and DT 903941 I only want Carters and DT returned. I have tried LEFT but it requires a number of characters and that varies. I much appreciate any help.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 02 Oct 2020 at 5:35am
left({table.field}, instr({table.field}, " ") - 1)


this way the number of characters is determined by where the first space is. I subtracted 1 character to remove the space.

HTH
IP IP Logged
amcapfixtures
Newbie
Newbie


Joined: 30 Sep 2020
Location: United States
Online Status: Offline
Posts: 2
Quote amcapfixtures Replybullet Posted: 02 Oct 2020 at 5:48am
Thank you very much!
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.047 seconds.