Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help with this query.
Besides using to_date, try using a 'between' clause instead of the
SHORTDATE >= '01-JAN-02' and SHORTDATE < '30-JAN-02'. Try something
like the following if you need 30-Jan to be non-inclusive
SHORTDATE >= to_date('01-JAN-02','DD-MON-RR') and SHORTDATE <
to_date('29-JAN-02 23:59:59','DD-MON-RR HH24:MI:SS')
HTH,
Pete's
Mladen Gogala <mgogala_at_earthlink.net> wrote in message news:<pan.2002.01.23.02.48.25.979737.1171_at_earthlink.net>...
> On Tue, 22 Jan 2002 23:58:12 -0500, Kev wrote:
>
> > Ok,
> >
> > I dont get this at all.
> >
> > Platform oracle 8i;
> >
> > From the SQL Plus I run this query and it works with no problem;
> >
> > select DATA_ID, DATAPOINT_ID, SHORTDATE, INTERVAL, VALUE, typeofday from
> > vw_Andy
> > where DATAPOINT_ID = 1
> > and (SHORTDATE >= '01-JAN-02' and SHORTDATE < '30-JAN-02')
> > order by shortdate, interval
> >
> > But now if I run this exact same query cut and paste in into VB, Delphi,
> > C++ it will not work. It returns nothing.
> >
> > I am using ADO. I have no clue as to what is going on. Does anyone have
> > a clue?
> >
> > any other query I run from VB, Delphi, C++ without using a date I have no
> > problems whatsoever. Just when I add a date it doesnt work. I dont get
> > it.
> >
> > Thanks,
> >
> > Kev
>
>
> That is the tool problem, not the query problem. In my opinion (I am a
> Unix guy, my favorite IDE is called "vi") you are encountirng a data
> conversion problem. The tool is "smart" and converts the column
> ("SHORTDATE") into VARCHAR2 instead of converting the constant
> expressions. You should try with TO_DATE() explicite conversion.
Received on Wed Jan 23 2002 - 08:24:12 CST