Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Seperating a text X/Y field Post Reply Post New Topic
Author Message
COBIT
Newbie
Newbie
Avatar

Joined: 11 Nov 2008
Location: United States
Online Status: Offline
Posts: 4
Quote COBIT Replybullet Topic: Seperating a text X/Y field
    Posted: 11 Nov 2008 at 2:45pm
I have a field {INMAST_VIEW.Map_Coordinates} that looks like this:
-96.123456/30.123456
I need to separate the lat from the long and put them in separate fields on the report.
I have used
Right ({INMAST_VIEW.Map_Coordinates},9 ) and
Left ({INMAST_VIEW.Map_Coordinates},10 )

but end up with a few fields that display the below
-96.1234/ or /30.12345

How can I make sure that everything to the right of the "/" is put in the long field regardless of the length, and everything to the left of the "/" is put in the Lat?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 11 Nov 2008 at 3:21pm
There are a couple of ways you can do this.  Probably the easiest way is to use the Split function which returns an array of the values.  You would use it this way to get the first value:
 
Split({INMAST_VIEW.Map_Coordinates}, '/')[1]
 
Replace [1] with [2] to get the second value.
 
-Dell
IP IP Logged
COBIT
Newbie
Newbie
Avatar

Joined: 11 Nov 2008
Location: United States
Online Status: Offline
Posts: 4
Quote COBIT Replybullet Posted: 12 Nov 2008 at 6:27am
THIS IS AWESOME! Thank you so much for your help! I had Tried Split first but didn't get the [1] or [2] part at the end right. It works like a champ now!

-Cory
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.