Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Helloi have tablex y za,10,10b,10,3a,3,2 and as i use:select x, sum(y), sum(z), sum(y)/sum(z)i have:a,13,12,1 (instead of 1,08...)b,3,2,1 (instead of 1.5) What should i do to have proper real value instead of int one ?
James K
Master Smack Fu Yak Hacker
3873 Posts
Posted - 2013-08-15 : 16:12:46
This is because of integer division. Force at least one of the pieces - numerator or denominator to non-integer type. For example any of these