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 -> Sorting results by date

Sorting results by date

From: <stuartirvine_at_my-deja.com>
Date: Fri, 25 Aug 2000 00:45:53 GMT
Message-ID: <8o4fjs$3c$1@nnrp1.deja.com>

I have a table which records when a user logs into the application table applogin
username varchar2(30),
logintime date,
etc.

I need to create a report which is grouped by day, and counts the number of times a user logs in each day.

select username, to_char(logintime,'MON-DD-YYYY'), count(*) from applogin
group by username, to_char(logintime,'MON-DD-YYYY') order by to_char(logintime,'MON-DD-YYYY')

This does the trick, but not in the right order. I need to sort the results by login date, by day. This query will sort the results by char order not date order i.e. Jan 1 , Jan 2 etc..

Any sugestions ???

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Aug 24 2000 - 19:45:53 CDT

Original text of this message

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