Solution for String Calculation

  • Hello,

    I thought I would pass along a solution that, thanks to several contributors, works very nicely for removing a street suffix from a street name:

    ****************************************************

    UPDATE tblSBStreetData

    SET StreetName =

    LEFT(StreetName,LEN(StreetName) - CHARINDEX(' ',REVERSE(StreetName)))

    WHERE

    streetname like '% RD'

    or streetname like '% DR'

    or streetname like '% ST'

    or streetname like '% AVE'

    or streetname like '% PL'

    or streetname like '% WAY'

    or streetname like '% CT'

    or streetname like '% ST'

    or streetname like '% LN'

    or streetname like '% CIR'

    or streetname like '% Drive'

    or streetname like '% Street'

    or streetname like '% Road'

    or streetname like '% Circle'

    or streetname like '% Avenue'

    or streetname like '% Blvd'

    or streetname like '% Exp.'

    *****************************************

    Thanks again for your help!

    CSDunn

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply