Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date ordering problem

Re: Date ordering problem

From: Roelof K. Salomons <roelofs_at_ic.uva.nl>
Date: Thu, 4 Jan 2001 09:00:11 +0100
Message-ID: <931ai4$pam$1@mail.ic.uva.nl>

M2,

Try 'J' in the format part instead of 'DD-MON-YYYY'. This will give you the Julian day.
Use the expression:

     to_number(to_char(date_logged, 'J')), count(*) etc.

Roelof K. Salomons
Database Administrator UvA
tel : 020 5252383
mobiel: 06 22126701
email: dba_at_ic.uva.nl
"M2" <mmortonallen_at_csu.edu.au> schreef in bericht news:9315k3$ki3$1_at_nnrp1.deja.com...
> Hi All,
> I have what appears to be a simple problem but I just can't get my head
> around it. I have the following query in a report how many actions were
> performed on a given day:
>
> select
> to_char(date_logged, 'DD-MON-YYYY'), count(*)
> from
> log
> group by
> to_char(date_logged, 'DD-MON-YYYY')
> order by
> to_char(date_logged, 'DD-MON-YYYY)
>
> My problem is that I need this to be in chronological order and it's in
> asciibetical order. I have tried lots of combinations of things but I
> always run into a problem. If anyone could shed some light on this for
> me I would really appreciate it.
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Thu Jan 04 2001 - 02:00:11 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US