Re: VB6, DAO, Oracle and dates....

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Fri, 26 Jul 2002 13:17:11 GMT
Message-ID: <rZb09.673234$cQ3.106019_at_sccrnsc01>


1 use USE 4 digit years.
2 change to_date('13/6/2002' ,'DD/MM/YY')=> to_date('13/06/2002' ,'DD/MM/YYYY');
3. why are you converting a date field in to_date? to_date(My_Date_Field,'DDMM/YY') That doesn't make sence. 4. You probably want:
Select * from ... where My_Date_Field> =  to_date('13/06/2002' ,'DD/MM/YYYY') and My_Date_Field< (to_date('13/06/2002' ,'DD/MM/YYYY')+1);

Jim

"Nyami" <nyami_at_hotmail.com> wrote in message news:d5bd14e9.0207260211.74528b4f_at_posting.google.com...
> I have an Oracle 8.1 database and using the oracle 7.3.4 client (there
> is a good reason and can't be avoided). I have a VB6 project that uses
> DAO and need to get some queries working that have a where clause on
> the date fields. The date fields in the database have a time stamp
> which in this case I do not need to take into consideration. In
> SQLPlus I can run the following query and get the results I expect.
> Select * from ... where to_date(My_Date_Field,'DDMM/YY') =
> to_date('13/6/2002' ,'DD/MM/YY');
>
> Problem is I can not use this syntax in the query definition, every
> time I try and return my record set with this query definition I get
> the following error:
> Error Code: 3085
> Description: Undefined function 'to_date' in expression.
> I have two possible ways round this but both require large changes in
> the code and/or environment, they are to create a view that converts
> the date, or to change the odbc drivers etc, both of which are not
> ideal.
>
> Is there any thing I am missing, I am hoping that its going to be so
> simple. I have seen a few workarounds for formatting the parameter (ie
> right hand side of equals) but I need to convert the field being
> returned (ie left).
>
> Cheers
> Nyami
Received on Fri Jul 26 2002 - 15:17:11 CEST

Original text of this message