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 |
|
latingntlman
Yak Posting Veteran
96 Posts |
Posted - 2006-02-24 : 10:26:47
|
I have an int field (number of seconds) and I need to get result as number of seconds divided by 60, but I can't get decimals to show.i.e. 3367 seconds divided by 60 should show 56.12 if rounded to two decimals, but it shows as 56.00.I've been using cast and convert but it won't work.Heeeeeelp!! |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-24 : 10:29:09
|
| select round(3367/60.0,2)MadhivananFailing to plan is Planning to fail |
 |
|
|
latingntlman
Yak Posting Veteran
96 Posts |
Posted - 2006-02-24 : 10:44:48
|
| It worked!! but now it shows six decimal digits and I still want it to display only two. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-24 : 10:47:24
|
| select cast(3367/60.0 as decimal(12,2))MadhivananFailing to plan is Planning to fail |
 |
|
|
latingntlman
Yak Posting Veteran
96 Posts |
Posted - 2006-02-24 : 10:53:38
|
| Thanks, it worked!! |
 |
|
|
|
|
|