Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date range grouping
I considered similar to this and I'm sure it would work as SQL. However,
I'm using Business Objects and do not know how to reproduce this in that
tool. Perhaps I really needed a Bisuness Objects news group?. This was
also why I was trying to avoid pre-processing. My real problem is not one
of specific dates but accounting periods which we have in a table - I told
you I simplified the problem. I've actually resorted to adding a new column
to the accounting periods table and as part of month changover run a script
which specifies the period it is regards to my report. i.e Before now, This
month, next month, ... , All other future months.
I can join my dates to an accounting period (using BETWEEN) and then group by my new 'period_type' column.
It seems to work.
Thanks for replying.
--
Alan D. Mills
Stewart Burnett wrote in message <6vfsft$6uo$1_at_hagen.cloud9.co.uk>...
>You could try;
>
>SELECT 'Before' WhenDate sum(MyVal) from MyTab where MyDate < Sysdate group
>by WhenDate
>UNION
>SELECT 'Today' WhenDate, sum(MyVal) from MyTab where MyDate = Sysdate group
>by WhenDate
>UNION
>SELECT 'Tomorrow' WhenDate, sum(MyVal) from MyTab where MyDate = Sysdate +
1
>group by WhenDate
>UNION
>SELECT 'After' WhenDate, sum(MyVal) from MyTab where MyDate > Sysdate + 1
>group by WhenDate
>
>with the syntax corrected, can't remember where the 'group by' & column
>aliases go.
>
Received on Thu Oct 08 1998 - 09:07:53 CDT