Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: token string Post Reply Post New Topic
Author Message
stilllearning
Newbie
Newbie


Joined: 17 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote stilllearning Replybullet Topic: token string
     Posted: 17 Mar 2011 at 7:57am
i'm new to this forum and still somewhat a beginner with crystal.  the issue that i am stuck on is a token string.  Here's what it looks like out of the database:

16    702
18    US TREASURY 310 SOC SEC   120310

I understand (I think) that the 16 and 18 are the numeric identifiers, but what i want to actually print on the report is the the wording US Treasury 310 Soc Sec.

Is there a way I can go about that in crystal? A formula?  Formula's are not my strong suit (yet).
I appreciate any feedback and assistance as this is my first post. :)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Mar 2011 at 8:36am
is that wording ("US TREASURY 310 SOC SEC") exctly the same in every row and is that only what you want printed per row?
IP IP Logged
stilllearning
Newbie
Newbie


Joined: 17 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote stilllearning Replybullet Posted: 17 Mar 2011 at 8:59am
no the wording can vary. i'm hoping to get the wording for each individual line.  i'm working on direct deposits and wanted to capture who/where the deposit is coming from.


Edited by stilllearning - 17 Mar 2011 at 9:00am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Mar 2011 at 9:03am

so you need some absolutes on the string structure to figure out a way to get to what you want.

can you give these based on more samples?
IP IP Logged
stilllearning
Newbie
Newbie


Joined: 17 Mar 2011
Location: United States
Online Status: Offline
Posts: 3
Quote stilllearning Replybullet Posted: 17 Mar 2011 at 9:21am
here are some other strings:

16    701
18    US TREASURY 312 CIVIL SERV010311
(would want US Treasury 312 Civil Serv)



16    501
18    RAYTHEON        PAYMENT   110101
(would want Raytheon Payment)

16    900
18    IN HOME HEALTH CPAYROLL        
(would want In Home Health CPayroll)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Mar 2011 at 9:36am
if isnumeric(mid({stringfield},7,1)) then '' else
mid({stringfield},7)
will return an empty string for the records that have 701, 501 and 900 in them and strip the lead "18    " from the other rows.
I think you will need a loop checking for NOT(isnumeric) to determine the value from right to left to trim the numbers off the end.
Is this on track for what you are trying tot do?
 
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