Bill Crawley
May 11th, 2009, 06:43 AM
Hi All,
I'm using SQLServer 2005.
In my SP I have an internal table with one of the columns declared as int.
As part of the insert statement, the value going into this column uses a simple formula of @Print_run/100 * @percentage.
Where my first iteration becomes:
1/100 * 75 = 0.75
So in my internal table, I want this rounded to 1, but 0 is entered.
I have tried all types of 'round' on the formula, but it makes no difference.
I have also tried Casting to Numeric before rounding, but that makes no difference either. Can anyone show me what I need to apply to my formula to get it to round correctly.
I'm using SQLServer 2005.
In my SP I have an internal table with one of the columns declared as int.
As part of the insert statement, the value going into this column uses a simple formula of @Print_run/100 * @percentage.
Where my first iteration becomes:
1/100 * 75 = 0.75
So in my internal table, I want this rounded to 1, but 0 is entered.
I have tried all types of 'round' on the formula, but it makes no difference.
I have also tried Casting to Numeric before rounding, but that makes no difference either. Can anyone show me what I need to apply to my formula to get it to round correctly.