Re: bands - sql statement

From: Mike Dwyer <dwyermj_at_co,larimer.co.us>
Date: 2000/05/22
Message-ID: <aLdW4.5$EL1.2886_at_wdc-read-01.qwest.net>#1/1


You might be able to use the "ceiling" function:

select ceil(minutes/15) band from your_table;

Minutes from 1 to 15 will be in band 1, 16 to 30 will be band 2, etc.

Ceiling returns the smallest integer greater than or equal to the argument.

"Cobra__77" <Cobra__77_at_hotmail.com> wrote in message news:4LNV4.1955$sW4.12850_at_news-server.bigpond.net.au...
> I have a field in a table that has time in minutes as integer...eg 1 , 2,
 3
> no upper limit...and I want to convert this into 15 minutes bands...eg 1
 to
> 1-15 , 2 to 1-15 ....and 16 to 16-30 ... 17 to 16-30..... etc etc
> so my bands are 1-15 , 16-30, 31-45 ..... no upper limit ...any way to do
> this conversion in sql?
>
>
>
>
>
>
Received on Mon May 22 2000 - 00:00:00 CEST

Original text of this message