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 |
|
lucasql
Starting Member
4 Posts |
Posted - 2002-10-21 : 05:11:34
|
| Hi, I have this problem:I would insert in a float field a value with . like separatorfor example:Now I insert in my field 10.2I would insert 10,2How can i do?thank you |
|
|
Crespo
85 Posts |
Posted - 2002-10-21 : 06:34:32
|
quote: Hi, I have this problem:I would insert in a float field a value with . like separatorfor example:Now I insert in my field 10.2I would insert 10,2How can i do?thank you
O.K I am not sure if I understand what you mean, but how about you use the REPLACE function.REPLACE('234,67', ',', '.')So, original value = 234,67after the REPLACE you should have 234.67Is that what you want? If not, please be more specific with your question.Best Regards.Crespo.Hewitt Bacon & WoodrowEpsomSurreyUnited Kingdom |
 |
|
|
lucasql
Starting Member
4 Posts |
Posted - 2002-10-21 : 06:37:34
|
| Thank you for your answer.I know that I could use replace... but in this project is better that I don't use replacethank youby byluca |
 |
|
|
Crespo
85 Posts |
Posted - 2002-10-21 : 09:26:15
|
quote: Thank you for your answer.I know that I could use replace... but in this project is better that I don't use replacethank youby byluca
OK... how about you use the following :Example,DECLARE @NUMBER VARCHAR(50)SET @NUMBER = '1236587,254'SELECT @NUMBERSELECT SUBSTRING(@NUMBER, 1, CHARINDEX(',' , @NUMBER)-1)+'.'+SUBSTRING(@NUMBER, CHARINDEX(',' , @NUMBER)+1, LEN(@NUMBER)- CHARINDEX(',' , @NUMBER))Hope this helps.Best Regards.Crespo.Hewitt Bacon & WoodrowEpsomSurreyUnited Kingdom |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-10-21 : 10:37:01
|
| I know some countries use "," as a decimal seperator instead of "." with the "thousands" seperator reversed...if this is the case for you, you should look into your regional/server settings....it's a display property, not a storage issue.... |
 |
|
|
|
|
|
|
|