1. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems decimal
Set as decimal using formula: SET Order_More_Copies = ((t.HoldCount/ @nNumberOfHolds) - t.ItemCount)
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
2. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems decimal
Set as decimal using formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - CAST(t.ItemCount as Decimal (5,0))))
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)100
3. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems decimal
Set as decimal using formula: SET Order_More_Copies =CONVERT(DECIMAL(5,1),1.00 * t.HoldCount / @nNumberOfHolds) - t.ItemCount
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
4. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems decimal
CAST @nNumberOfHolds and @nNumberOfItems as decimal formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - t.ItemCount )) t.ItemCount )) and t.ItemCount left as int in the formula.
Result:
Items Holds Order_More_Copies
100 727 45
5. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems int
Set @nNumberOfHolds as decimal and @nNumberOfItems as int using formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - CAST(t.ItemCount as Decimal (5,0))))
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
6. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems int
Set @nNumberOfHolds as decimal and @nNumberOfItems as int using formula: SET Order_More_Copies =CONVERT(DECIMAL(5,1),1.00 * t.HoldCount / @nNumberOfHolds) - t.ItemCount
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
7. With DECLARE @nNumberOfHolds decimal;
DECLARE @nNumberofItems int
Set @nNumberOfHolds as decimal and @nNumberOfItems as int using formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - t.ItemCount ))
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
8. With both DECLARE @nNumberOfHolds int;
DECLARE @nNumberofItems int as integer
Using formula: SET Order_More_Copies = ((t.HoldCount/ @nNumberOfHolds) - t.ItemCount)
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
9. With both DECLARE @nNumberOfHolds int;
DECLARE @nNumberofItems int as integer
Using formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - t.ItemCount ))
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
10. With both DECLARE @nNumberOfHolds int;
DECLARE @nNumberofItems int as integer
Using formula: SET Order_More_Copies = (((CAST(t.HoldCount as Decimal (5,0))) / CAST(@nNumberOfHolds as Decimal (5,0)) - CAST(t.ItemCount as Decimal (5,0))))
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)
11. With both DECLARE @nNumberOfHolds int;
DECLARE @nNumberofItems int as integer
Using formula: SET Order_More_Copies =CONVERT(DECIMAL(5,1),1.00 * t.HoldCount / @nNumberOfHolds) - t.ItemCount
Result:
Items Holds Order_More_Copies
100 727 45 (would like it to show 145.40)