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 |
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-11-02 : 01:54:25
|
| The / operator returns the quotient of the first expression divided by the second expression. Is there a way we can get the actual value after division? |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-11-02 : 02:06:50
|
| Are you looking for the remainder of the division; use % (modulo) operatorHemanth GorijalaBI Architect / DBA (yuhoo!!! and now, an "Yak Master")Exchange a Dollar, we still have ONE each.Exchange an Idea, we have TWO each. |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-11-02 : 02:13:47
|
| No it is not resolving the issue. You do 13/12 in in calculator or Excel and in Query Analyzer as well you will see the problem. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-11-02 : 02:17:34
|
| print convert(decimal(10,2),13.00/12.00)--------------------keeping it simple... |
 |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-11-02 : 02:20:04
|
| Well, in SQL, int divided by int results an int.so, convert to numeric or decimal.Select Convert(numeric,13)/12Hemanth GorijalaExchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each. |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2004-11-02 : 02:25:09
|
| Thanks Hemant |
 |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-11-02 : 03:12:16
|
thank Jen. She beat me to it Hemanth GorijalaExchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each. |
 |
|
|
|
|
|
|
|