| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: simple query not so simple
"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,
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
![]() |
![]() |