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

Home -> Community -> Usenet -> c.d.o.misc -> Re: simple query not so simple

Re: simple query not so simple

From: Dmytro Dekhtyaryuk <dekhtyaryuk_at_materna.de>
Date: Mon, 10 Oct 2005 10:05:07 +0200
Message-ID: <did7bq$9la$1@pentheus.materna.de>

"Bob" <Go1369_at_Yahoo.Com> schrieb im Newsbeitrag news:1128922971.771520.226820_at_g43g2000cwa.googlegroups.com...
> SQL=
>
> select count(*),sum(atp_amount) from fdsmastrep where trans_month =
> 10/1/2004
>
> the trans_month field is a date field and I need to get the records for
> the year beginning 10/1/2004 and ending 9/30/2005
>
> I get an "inconsistent data types" error.
>
> can somebody help me out?
>

Hallo,

  1. If you want to have an interval, why did you wrote trans_month = 10/1/2004 ?
  2. You have to write the dates with ''

 select count(*),sum(atp_amount) from scott.fdsmastrep

 where to_date(trans_month, 'DD/MM/YYYY') between

 to_date ('10/1/2004', 'DD/MM/YYYY') and to_date ('30/9/2005', 'DD/MM/YYYY').  You have to read a bit more documentation.

 Regards

 Dmytro Dekhtyaryuk Received on Mon Oct 10 2005 - 03:05:07 CDT

Original text of this message

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