Hi
I have a problem with a case function that I hope someone can help me with.
I have the following code:
CASE WHEN S.SumOfSchedule_Qty > 0 THEN (S.SumOfSchedule_Qty - 1) / S.Pallet_Qty)
ELSE 0
END AS DecNoOfPallets
The problem with it is that is for example SumOfSchedule_Qty = 20 and Pallet_Qty is 3 it gives me the answer as 7 whereas I want it to come out as 6.66666666
I tried convert(decimal(18,8) but this made the calculation first round it up and then did the convert.
Any ideas?
Aaron