var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Pseudocode to SQL stored proc math operation
How do i implement this pseudocode in a SQL stored proc?
In my stored proc, intDS and intSS are the corresponding locally declared variables: @cnt1 and @cnt2 (both are int's).
double intRating = 0;
if (intDS != 0)
intRating = ((intDS - intSS ) / intDS) * 100;
if (intRating < 0)
intRating = 0;
intRating = RoundUpDown(intRating);
The last line should round up or downd the decimal value, if it has decimals, to the next round/whole number... e.g. 28.4352635 to 28.
I'd say the Round() function does what you want. Look it up in BOL and tell us if that works for you, or why not.
something like this
if (@intDS <> 0)
select @intRating = ((@intDS - @intSS ) * 100.0 / @intDS)
if (@intRating < 0)
select @intRating = round(@intRating, 0)