Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2002
    Location
    Pakistan-Karachi
    Posts
    1

    Unanswered: Remove Enter from Address Field

    Dear Friends,

    Hi, I am facing very big problem but i think it's not big problem for expert. my problem is below,

    i want remove all enter from my address filed and it type is TEXT

    Thank you,
    Qainan Idris

  2. #2
    Join Date
    May 2002
    Location
    Cape Town , South Africa
    Posts
    30

    Cool Address Fields

    Hi Qainan ,

    Do you want to remove the e-mail address from the address book and type it in yourself?when do you want to do this ?whilst setting up an e-mail operator? all you need to type is the e-mail address for example , where it ask you for the operators e-mail address all then you can type e.g me@me.com adn then test it should work , it worked for me.

    I am not sure if this is what you meant , i hope this helps , if it doesnt pls reply ..

    Regards
    Burner

  3. #3
    Join Date
    Jul 2002
    Location
    Naples, Florida, USA
    Posts
    1
    Depending on whether you use char(13) + char(10) or just char(13) for the [Enter] -- can't you just UPDATE using the Left function and the Len(text)-2 or Len(text)-1 ?

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Use the replace function.

  5. #5
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Unfortunaly, function replace does not work with text field...

    Try this one...

    create table address(id int,address text null)

    insert address
    select 3,'12345678
    Red Drive
    Bigtown
    NY
    dr
    45098'

    It needs to fire couple times this batch to replace all 'Enters':

    declare @rt varchar(4)
    set @rt='%'+char(13)+char(10)+'%'
    update address
    set address=ltrim(substring(address,1,patindex(@rt,add ress)-1)+' '+
    substring(address,patindex(@rt,address)+2,DATALENG TH(address)))

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    snail: Not quite - that is why we have the cast/convert functions.

    qainan: The replace function works fine but you will have to nest a cast/convert function with your text field

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •