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

Re: date

From: Jim Kennedy <jim>
Date: Sun, 7 May 2006 17:20:23 -0700
Message-ID: <__ydnb-gh4WuE8PZnZ2dnUVZ_uudnZ2d@comcast.com>

"johnj" <u21624_at_uwe> wrote in message news:5fead11a855d8_at_uwe...
> thanks Jim. pls look at the code below, the last line. I'm I right?
>
> SELECT customerID, lname, fname, SUM(cost,extrCharges) * 100 AS percent
> FROM customer c, customerCharges ch
> WHERE c.customerID = ch.customerCharges
> AND YEAR(c.orderdate) = YEAR(2001());
>
> Jim Kennedy wrote:
> >> I have a query that I wanted it to return percentage charges within the
year
> >> 2001
> >[quoted text clipped - 8 lines]
> >>
> >> johnj
> >
> >and
> >the_date>=to_date('1/1/2001','dd/mm/yyyy') and
> >the_date<to_date('1/1/2002','dd/mm/yyyy')

I don't think there is a YEAR function. Also in your example the YEAR(c.orderdate) will not allow you to use an index on orderdate if there is one. Also what is 2001()? It isn't anything Oracle knows about. Jim Received on Sun May 07 2006 - 19:20:23 CDT

Original text of this message

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