UK Post code Area

  • I thought something like the following may be helpful as well , based on your requirements of course...

    select postalCode = Case when patindex('%[0-9]%',postalcode) > 0

    Then left(postalCode, patindex( '%[0-9]%',postalCode)-1)

    Else postalCode

    END

    From yourTable;

    ----------------------------------------------------

Viewing post 16 (of 15 total)

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