Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql server 2000 functions "floor" and "ceil" 1

Status
Not open for further replies.

tempo1

Programmer
Feb 20, 2007
118
Hi everyone,
I tried
Code:
floor(5/2)
and recieved 2 which is satisfactory.
But i also tried
Code:
ciel(5/2)
and got an unsatisfactory error message saying
that
'ceil' is not a recognized function name.
.
Can any one show me what i should write instead of "ciel" to get "up rounded" number ?
Thanks
 
erm, ceiling...?

--------------------
Procrastinate Now!
 
yepp...
but something happens:
floor(5/2) yields "2" as well as ceiling(5/2). How do i write it to get 3 ?
Thanks
 
5/2 is integer division, so result is actually 2

5.0/2.0 will give you a result of 2.5 and thus the correct ceiling result...

--------------------
Procrastinate Now!
 
Thanks a lot crowley16.
You were very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top