SQLTeam.com | Weblogs | Forums

Incrementing case statement problem

#1

Hi
I have googled but cannot find an unswer to this. I am probably googling the wrong thing :slight_smile:
I have a field and each time it increments by a specified value the results increments
So days between 0.5 and 2 returns the value 0.5, between 2.1 and 4 returns 1.00, between 4.1 and 6 returns 1.5
How do I write this without having to create a line for every value. Any help would be appreciated.
Case
when days <= 2 then 0.5
when days <=4 then 1.0
when days <= 6 then 1.5
when days <= 8 then 2.00
end as Due_Days,

0 Likes

#2

(ceiling(days)+ceiling(days)%2)*.25

1 Like

#3

Thank you

0 Likes