Why don't you try checking for the occurrence of the new email address in the string BEFORE you concatenate it. If you find the email address is already in your string then do not add it and move to the next record in your table.
On Fri, Mar 7, 2008 at 9:34 AM, Darshana Jivan [MTN Network Solutions] <[EMAIL PROTECTED]> wrote: > ** > > > > Hi, > > > > Please can someone assist me with the following. > > > > I want to remove duplicate email addresses in a string. I cannot create a > view with the distinct values as I need the unique id's of the record > therefore the only option I do have is to try and remove duplicate > occurrences after the 1st occurrence of an email address. > > > > This is the following process that I am using but I know that the last set > fields with the replace function is not doing what I require it to do and > there is where I need some assistance. > > > > I have a AL that fetches and email address and concatenates it to a string > in a loop. > > SQL Command: SELECT CONTACT_EMAIL FROM [EMAIL PROTECTED] WHERE CONTACT_ID > = '$Col_C_ContactID$' > > Set Fields 1: Email > > $1$ > > Set Fields 2: MTNNS_primary_client_contact_email > > ($MTNNS_primary_client_contact_email$ + ",") + $Email$ > > > > I then have another AL that does the following when it finds a match of an > email address in the string 'MTNNS_primary_client_contact_email' > > Set Fields 1: Val1 > > STRSTR($MTNNS_primary_client_contact_email$, $Email$) > > Set Fields 2: Val2 > > LENGTH($Email$) > > Set Fields 3: > > REPLACE($MTNNS_primary_client_contact_email$, > SUBSTR($MTNNS_primary_client_contact_email$, $Val1$, $Val2$), "") > > > > In essence if I have a table with the following email addresses and when its > looped through the string or the value I am looking for is [EMAIL PROTECTED], > [EMAIL PROTECTED], [EMAIL PROTECTED] the duplicate occurrence should be > extracted from the string. > > > > [EMAIL PROTECTED] > > [EMAIL PROTECTED] > > [EMAIL PROTECTED] > > [EMAIL PROTECTED] > [EMAIL PROTECTED] > > > > __Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" > html___ _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

