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.
| Author |
Topic |
|
1sabine8
Posting Yak Master
130 Posts |
Posted - 2009-06-01 : 04:46:47
|
| Hi,I have an id in this form:2321-8794-8777I need to know how i can remove the '-' from it and convert the result to int.How can this be done in the query?Thanks in advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-01 : 04:48:54
|
SELECT CAST(REPLACE(Col1, '-', '') AS BIGINT) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-06-01 : 04:49:31
|
you will need bigint for thatselect convert(bigint, replace('2321-8794-8777', '-', '')) KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|