I was looking for a way to round up the results of a query to the next whole number and after
fair bit of searching the net and experimenting to get this to work in SQL 2005
The result was
declare @totalpallets as int
declare @total as int
declare @palletsize as int
set total_pallets = (select ceiling(cast(@total as float)/cast(@palletsize as float)))
This does the job admirably
No comments:
Post a Comment