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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2011-02-24 : 11:37:59
|
| I like to display one decimal point with the result of division.For example, 7/12 = 58.3% (a/b=xx.x%)How to use cast and dec function to make it? |
|
|
wided
Posting Yak Master
218 Posts |
Posted - 2011-02-24 : 11:46:34
|
| declare @var dec(15,2)select @var = (7/12.0)*100le résultat est 58.33wided |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-24 : 11:52:19
|
| select cast((7/12.0)*100 as decimal(4,1))MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|