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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to seperate the data in fields after commas

Status
Not open for further replies.

lavadan

Programmer
Dec 17, 2007
49
US
Hi All,

I have a question on how to solve this in crystal XI:

I have a field from a table which looks like-
Sammy, Green, Public, Beach
I want to display it in crystal reports as
Sammy(Green, Public, Beach)
- i.e. after the first & last commas , there should be brackets

Does anybody have any idea how to implement this?
 
local stringvar test := {database field}
local stringvar output;

output := left(test,instr(test,",")-1) & "(" & right(test,length(test)- instr(test,",") - 1) & ")";

This can be done without any variables by placing your database name anywhere it says test.
 
Thanks a lot. It worked like a charm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top