I have a quite simple task:
I must check in wchich group my float is.
Here are my groups:
- 0-30 display “(0-30)”
- 30-40 display “(0-30)”
- 40-50 display “(0-30)”
- 50-60 display “(0-30)”
- etc
I have created a simple script:
DECLARE @num FLOAT
SET @num = 42.5;
SELECT CASE WHEN @num<=30 THEN '(0-30)'
ELSE '('+convert(VARCHAR,convert(INT,round((@num/10),0))*10)+'-'+convert(VARCHAR,convert(INT,round(((@num+10)/10),0))*10)+')'
END
I think it is a little lame, so if anyone could help me out with creating a better solution 🙂
Thanks for any advice 🙂
Use: