Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Extract First Word from a String Value Post Reply Post New Topic
Author Message
niloc
Newbie
Newbie
Avatar

Joined: 18 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote niloc Replybullet Topic: Extract First Word from a String Value
    Posted: 18 Nov 2009 at 3:52am
I need to extract just the first word from a string value in a formula in Crystal Reports XI, but as the first word is variable and also of a varying length I cannot workout how to do this. Can anyone help as the dent in the wall where my head has been hitting it is slowly getting larger!!

Examples:

Fred Bloggs
Freda Bloggs
Joe Bloggings
Joanne Bloggings
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 18 Nov 2009 at 5:08am
split({table.namefield}, " ")[1]
This will give you the first part of a string that is separated by a space.
IP IP Logged
niloc
Newbie
Newbie
Avatar

Joined: 18 Nov 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote niloc Replybullet Posted: 18 Nov 2009 at 5:31am
Perfect - thanks for your speedy response :)
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.