data entry problem

  • Hi

    I have just started a new job and on browsing the database have realised that when the names and addresses data was input into the new system (4 months ago) the person inputing the data has put it all in address field 1, with the seperate parts of the address delimitered by comma's.

    Is there a way to automatically (via sql) to move the seperate parts into address field 2-3-4-5

  • Can you give us samples of the type of data you have?

    Basically, you could use PATINDEX or CHARINDEX to find each comma and separate it that way. For example:

    1. put the value into a variable

    2. get the first part by grabbing the string upto the comma.

    3. put the rest back into the variable (so that now the variable is missing the part taken out)

    4. continue this until you have parsed the whole value.

    -SQLBill

  • THANKS SQLBILL

    THE DATA IS SIMPLE ADDRESS TEXT EG

    14 THE RIDE,WOKING,SURREY,GU34 5SF

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

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