Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting First Word in String

Status
Not open for further replies.
Joined
May 26, 2005
Messages
1
Location
US
I using Crystal Reports 9 and am connected to a SQL Server 2000 DB. I am trying to get the first whole word in each string to use as the Group Title. For example, with Adobe Acrobat 5.0 CD, I want to return Adobe into the Group name. I have tried to use a For loop but it returns the whole string minus any spaces. Here is the formula:

Local StringVar str := "";
Local NumberVar strLen := Length ({Software.Software});
Local NumberVar i;
For i := 1 To strLen Do
(

if {Software.Software} <> " " then
str := str + {Software.Software}
else
str
);
str


Does anybody know the proper formula to make this work? Thanks for any help.
 
Use:
Code:
Split({Software.Software}, " ")[1]

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top