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 biv343 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.
May 26, 2005
1
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top