Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 remove space mid text

Author  Topic 

KTRUSH
Starting Member

1 Post

Posted - 2012-06-17 : 23:03:37
I am using SQL to manipulate a database that contains phone numbers. The phone number field was an open field and the data is a mess. I need to determine how many have the right number of digits and start with the right number.

I am new to sql. i am using a text query in excel to query a csv file.

I have successfully used the LEN( command, but the field often has multiple spaces. I have tried to use the replace command but as far as I can understand it does not work when using: TextConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" + TextDataDir + ";" + _
"Extended Properties=""text;HDR=Yes;FMT=Delimited"""

can anyone help? I'm very lost but working to a very tight deadline.

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-06-17 : 23:10:10
why not just use Excel to open the CSV file and do it at excel end rather than at SQL end ?

Excel should have sufficient text manipulation function to get the job done


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -