Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Text to Columns Post Reply Post New Topic
Author Message
LSelf
Newbie
Newbie


Joined: 27 Jun 2012
Online Status: Offline
Posts: 3
Quote LSelf Replybullet Topic: Text to Columns
     Posted: 27 Jun 2012 at 12:49pm

Data Example:  "010.00-PRIM TB Complex"

Question:  I need "010.00" in Col 1 and "PRIM TB Complex" in Col 2; need help on the best way to accomplish this.  Thank you in advance. 
 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 27 Jun 2012 at 1:18pm
Is the string always separated at the dash?  if so you should be able to use instr and left to get the "010.00" and instr, len and right to get the rest.  Something like this.
left({String_field}, instr({String_field},"-")-1)
and
right({String_field},len({String_field})-instr({String_field},"-"))
IP IP Logged
LSelf
Newbie
Newbie


Joined: 27 Jun 2012
Online Status: Offline
Posts: 3
Quote LSelf Replybullet Posted: 27 Jun 2012 at 1:38pm
Yes, the dash is always present. 
 
I'll give your suggestion a try.  Thank you for your response.
IP IP Logged
LSelf
Newbie
Newbie


Joined: 27 Jun 2012
Online Status: Offline
Posts: 3
Quote LSelf Replybullet Posted: 27 Jun 2012 at 1:45pm

Worked perfectly!  Thank you

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