cm62597
SSC Eights!
Points: 976
More actions
May 5, 2009 at 11:30 am
#133778
SELECT
5/2 as ans
The above returns 2. The right answer should be 2.5. I would like for SQL to output 3. Not sure if this is possible. Does anyone know?
Ken Simmons
SSCertifiable
Points: 7822
May 5, 2009 at 11:47 am
#989073
You have to convert one of the columns... Try this.
select ceiling(5/2.0)
You may need to use round depending on your requirements. For example, ceiling will always round up.
select Ceiling(2.1), ROUND(2.1,0)
May 5, 2009 at 12:53 pm
#989115
Thanks that works great!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply