Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: duplicate entries in a field

    Try this,

    should work with any duplicate comma separated endings

    UPDATE 

      table

    SET 

      Location=LEFT (Location, LEN(RTRIM(Location)) - CHARINDEX(',', REVERSE(RTRIM(Location))))

    WHERE

      CHARINDEX(

     SUBSTRING(

      RTRIM(Location),

      LEN(LEFT (Location, LEN(rtrim(Location)) - CHARINDEX(',', REVERSE(RTRIM(Location)))))+1,

            CHARINDEX(',', REVERSE(RTRIM(Location)))),

     LEFT(Location,LEN(RTRIM(Location)) - CHARINDEX(',', REVERSE(RTRIM(Location))))

       )>0

     

    Magnus W

Viewing post 1 (of 1 total)