9,695 pts.
 SQL divisions
Hi All, I'm trying to make a calculation through SQL code but this is resulting in a 0. Example: declare @activities as integer declare @days as integer declare @media as float --my queries that extracts data and sets values to @days, @activities; in this case they return @activities=51 and @days=199 set @media = @activities/@days select @days as Days,@activities as Acts, @media as Media and this results in Days - Acts - Media 199 51 0 Why this result, instead of 0,25628140703517587939698492462312 ?

Software/Hardware used:
ASKED: January 28, 2009  3:43 PM
UPDATED: January 28, 2009  3:50 PM

Answer Wiki:
I found the solution by myself by simply changing the: <pre>declare @activities as integer declare @days as integer declare @media as float </pre> to <pre>declare @activities as float declare @days as float declare @media as float </pre>
Last Wiki Answer Submitted:  January 28, 2009  3:46 pm  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks for posting the solution

Sean
Community Manager

 0 pts.