Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: FW: MS SQL Converting variables


Message #1 by Bukovansky@a... on Fri, 23 Feb 2001 11:12:39 +0100
Hi, I have problem with converting string variable into float.
In DTB, numbers are deposited in czech number format (123,45) as strings.
It must be, it's very old DTB structure and very bad designed, so I can't
change the type of item to float.
So when I in SP convert this number to float, ie:
SELECT @StrPrice = CONVERT(float(53), REPLACE('123,12', ',','.'))
(number is from DTB as a string variable), the float variable looks
like rounded to 1 decimal place (123.1).
What's bad?

BTW If I run this command
PRINT CONVERT(varchar(30), CONVERT(float(53), REPLACE('123,12',',','.')))
in SQL Query Analyzer, it gaves me the right number 123.12.

Thanks for support. Plz for answer ASAP (rather if is possible immediately).

Regards,

Richard Bukovansky

  Return to Index