Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Splitting a string into separate field values Post Reply Post New Topic
Author Message
jline
Newbie
Newbie


Joined: 03 Apr 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote jline Replybullet Topic: Splitting a string into separate field values
    Posted: 03 Apr 2014 at 2:55pm
Hi All,

I am currently in the middle of doing a report, and have been stuck on this for quite some time.

I'd like to split a string into separate field values. They are currently separated by spaces.


Summary Fields can vary, e.g. "Adobe Facebook Photoshop Reader"

A ticket number is the main identifier, and they are all linked to this.

At the moment, the output is:

TicketNumber1 Adobe Facebook Photoshop Reader

The desired output would be:

TicketNumber1 Adobe
TicketNumber1 Facebook
TicketNumber1 Photoshop
TicketNumber1 Reader



Any help is much appreciated. Thanks
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 04 Apr 2014 at 11:45am
something like this should work
left( your_field,instr(instr(your_field," ") +1 ,your_field," "))
IP IP Logged
jline
Newbie
Newbie


Joined: 03 Apr 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote jline Replybullet Posted: 06 Apr 2014 at 1:21pm
Hi,

Thanks for your reply. But that's not giving the desired output. There are no errors, however, it's not even returning the first desired field of "Adobe".
IP IP Logged
jline
Newbie
Newbie


Joined: 03 Apr 2014
Location: Australia
Online Status: Offline
Posts: 3
Quote jline Replybullet Posted: 10 Apr 2014 at 2:20pm
Bump
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Apr 2014 at 3:53am
do you really need this in different fields or just in a format like the above, as in a text box with line returns in it? Even if it is in different fieds it is still going to be part of the same detail row, it will not create new rows of data.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Apr 2014 at 3:59am
{ticketnumber} + " "+ replace({String}," ",(chr(13)+ {ticketnumber}+" "))
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.031 seconds.