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 |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-04-11 : 18:42:42
|
| I have a sp that receive a rango of float values,and I need to convert this values to a varchar(20).I am trying the next but I got a strange result.@intNoTarjIni = 121456790set @strTarjeta=cast(@intNoTarjIni as varchar(20))returns: 1.21457e+008set @strTarjeta=convert( varchar(20),@intNoTarjIni)returns:1.21457e+008How can I convert sucessfully a float to varchar? |
|
|
ravilobo
Master Smack Fu Yak Hacker
1184 Posts |
Posted - 2006-04-12 : 02:43:20
|
-- following code should workDECLARE @intNoTarjIni float ,@strTarjeta varchar(20)SELECT @intNoTarjIni = 121456790 SET @strTarjeta=str(@intNoTarjIni)SELECT @strTarjeta ------------------------I think, therefore I am - Rene Descartes |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-12 : 04:10:40
|
| Why do you want to convert to varchar?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|