How do I define my own hardcoded Ceilings and Floors in Sql Server?

ChUlitAtaMonn

New Member
I have some sql statements that calculates some numbers. It's possible (with bonus points/penalty points) that a person could get a final score OVER 100 (with bonus points) or UNDER 0 (with penalties).How can i make sure that the value calculated, if it exceeds 100 it get's maxed at 100. Alternatively, if the score ends up being below 0, then it's min'd at 0.I'm assuming I could use a simple UDF that does this math - that's not hard. I'm not sure if this already exists?I checked out CEILING and MAX and both of these are doing other things, not what I'm after.Thoughts?
 
Top