Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Trim trailing text? Post Reply Post New Topic
Author Message
cagirl95864
Newbie
Newbie
Avatar

Joined: 17 Apr 2009
Location: United States
Online Status: Offline
Posts: 4
Quote cagirl95864 Replybullet Topic: Trim trailing text?
     Posted: 17 Apr 2009 at 12:01pm

I need to trim all text to the right of a dash(-) and can't figure out how. The trim functions seem to be for numbers only. 

For example, the field will result in Special Permit-Other, Variance-Fence, Plan Review-Minor Modification.   I want to only display Special Permit, Variance or Plan Review in my Crystal report.
 
What's the best way to do this??


Edited by cagirl95864 - 17 Apr 2009 at 12:02pm
-cagirl95864
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Apr 2009 at 12:27pm
mid({table.fieldtotrim},1,instr({table.fieldtotrim},"-")-1)
IP IP Logged
cagirl95864
Newbie
Newbie
Avatar

Joined: 17 Apr 2009
Location: United States
Online Status: Offline
Posts: 4
Quote cagirl95864 Replybullet Posted: 17 Apr 2009 at 3:30pm
Thank you so very much!  That worked.
-cagirl95864
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