Replace function

  • Can any one post an example of how to use Replace method for replacing values of a column?

    Address columns has commas to be replaced by a space.

    Select LastName, FirstName, Address

    from tblEmployee

     

     

  • Actually you could just press F1 and type REPLACE in index keyword box.

    Would get answer much faster.

    REPLACE(AddressString, ',', ' ')

    _____________
    Code for TallyGenerator

  • but how i can pass the address value? from address column in table.

    have more than 300 rows.

  • UPDATE Table1

    SET Col1 = REPLACE(Col1, ',', ' ')

     


    N 56°04'39.16"
    E 12°55'05.25"

  • are you sure there arent any lines of the address that are meant to have spaces in them. So when you spilt the address on space you will cut lines in half. You should be populating another table with a column for each line spilting out the values between the commas.

    www.sql-library.com[/url]

  • If this is a varchar col, this won't help. '' and ' ' are the same.

    Can you give a sample of the before and after items in the table?

    Both Peter and Jules have given you the right idea.

  • thanks everyone for replies. update column worked perfectly.

    Thank you peter.

Viewing 7 posts - 1 through 6 (of 6 total)

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