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

Comparing, Split, Join

Status
Not open for further replies.

vangyer

Technical User
Sep 25, 2012
5
US
Dear all,
can't get my head around this,
basically i have a set of values

1234.43.23.12
458.12.32.14
1234.43.23.13

I'd like to concatenate them like so:
1234.43.23.12,.13; 458.12.32.14

so basically compare all the numbers before the last "." if they are the same then only concatenate the last numbers after the last ".". If they are not the same then just concatenate them normally divided by ";".

Appreciate your help, this forum is great!
 
Assuming they always end as .##
you can group on first part of number using formula

@group
right(yourfield, (length(yourfield)-3))

Create 3 formula

@reset // place in group header and suppress
whileprintingrecords;
global stringvar list:=@group;
global numbervar itemcount:=1;


@eval // place in details and suppress detail section
whileprintingrecords;
global stringvar list;
global numbervar itemcount;

If itemcount <> 1 then list:= list & "; "& left(yourfield, 2);

itemcount:=itemcount+1;

@display // place in group footer
whileprintingrecords;
global stringvar list;

Ian







 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top