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 |
|
hirani_prashant
Yak Posting Veteran
93 Posts |
Posted - 2008-04-14 : 05:10:50
|
| Hello All,Current Format :- 40.3 49.4 62.8 75.5 89.2 100 112 127Required Format40.30 49.40 62.80 75.50 89.20 100.00 112.00 127.00Currently mine above row data type is float. i need two points after precisions. Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-14 : 05:12:00
|
Use CAST. For more information read Books Online "Cast & convert". E 12°55'05.25"N 56°04'39.16" |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-14 : 05:12:46
|
If possible change data type from float to numeric or decimal, else use cast/convert.Select cast(col as numeric(10,2)) as col from table by mere 46 secs.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-14 : 05:17:35
|
| Here is why Harsh suggested you to change the data type from floatdeclare @f floatset @f=40.3select @f,@f*1MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|