Friday, March 30, 2012

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 IdrisHi 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|||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 ?|||Use the replace function.|||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)))|||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

No comments:

Post a Comment