Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: String Help Post Reply Post New Topic
Author Message
Dejaneira
Newbie
Newbie


Joined: 11 Sep 2015
Location: United States
Online Status: Offline
Posts: 15
Quote Dejaneira Replybullet Topic: String Help
    Posted: 21 Mar 2020 at 4:52am
I am trying to separate a string into its individual parts and somewhere I am missing a step.

Problem:
I have a text field 'Contract Number' which is actually 'Contract Number' - 'Description' and I need to remove the dash and Description from the text string.

Limitations:
I cannot key off the dash because the contract number may also contain a dash or more than one dash.
I cannot Trim Left because the contract number may be a variety of lengths depending on the contract.

I can access the Description field separately. I have tried comparing and removing the Description field, I tried counting the characters in the Description and then trimming. Somewhere I am missing something.

Can anyone point me in the right direction?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 23 Mar 2020 at 4:35am
So the question is, are there any dashes in the comments?  If not.  you could use inStrRev to find the first dash.  Otherwise  I am not sure how you would find it unless you do some sophisticated parsing of the data (i.e., if there is a number after the dash ignore it, but if there is a space then flag it).
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.