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!

Splitting csv field to separate detail rows 1

Status
Not open for further replies.

amoeba102

Programmer
Apr 2, 2002
58
US
I have a field that may have from 0 to 12 comma separated values. I need to display each value on a separate detail row. Using CR9. I tried creating a view, but failed terribly. This is against a SQL Server database which I have never used before. I'm used to Oracle.
 
Try creating the following formula and place it in your detail section:
Code:
join(split({table.field},","),chr(13));

Right click the field once it is on the report, and choose Format field.
Under Common tab, choose Can Grow.

The formula will split the field into an array using the comma as a delimter. It then joins each element of the array back together using a new line character (chr(13)). The Can Grow will allow for the field to expand to the size it needs to be.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top