Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!materna.de!not-for-mail
From: "Dmytro Dekhtyaryuk" <dekhtyaryuk@materna.de>
Newsgroups: comp.databases.oracle.misc
Subject: Re: simple query not so simple
Date: Mon, 10 Oct 2005 10:05:07 +0200
Organization: MaternaGmbH
Lines: 45
Message-ID: <did7bq$9la$1@pentheus.materna.de>
References: <1128922971.771520.226820@g43g2000cwa.googlegroups.com>
NNTP-Posting-Host: bui-nb013.bui.materna.com
X-Trace: pentheus.materna.de 1128931514 9898 139.2.54.179 (10 Oct 2005 08:05:14 GMT)
X-Complaints-To: news@materna.de
NNTP-Posting-Date: Mon, 10 Oct 2005 08:05:14 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:122541


"Bob" <Go1369@Yahoo.Com> schrieb im Newsbeitrag 
news:1128922971.771520.226820@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




