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: How to group a date field by month or day ?

Re: How to group a date field by month or day ?

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Fri, 20 Aug 1999 03:44:41 GMT
Message-ID: <37c6c7ce.51326333@netnews.worldnet.att.net>


On Thu, 19 Aug 1999 11:34:47 +0200, "Michael Keppler" <Michael.Keppler_at_bigfoot.com> wrote:

>In local SQL I used "EXTRACT(MONTH FROM datefield) AS M" to get the
>month information out of a date field. How do I write this statement for
>Oracle SQL to group my data by month ??

SELECT TO_CHAR(datefield,'MM') from yourtable;

DD gets you the day, YYYY the year, MON the month in JAN, FEB, MAR form, and so forth. HH, MI, SS get you hours, minutes and seconds.

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Thu Aug 19 1999 - 22:44:41 CDT

Original text of this message

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