Re: Syntax/Format of Date Literals

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Fri, 17 May 2002 14:08:37 GMT
Message-ID: <F98F8.44345$UV4.7262_at_rwcrnsc54>


Use bind variables and include the time in the to_date eg to_date( myvar, 'mm/dd/yyyy hh24:mi:ss') for 05/13/2002 15:23:07
Jim
"Scott" <scotterickson_at_mail.com> wrote in message news:3628077d.0205170458.2b26c9fd_at_posting.google.com...
> I'm using ADO to read data from an Oracle table. The Oracle table has
> a CREATED_ON field that is a date/time format. I need to add
> selection criteria to my WHERE clause that selects records created
> within a specific date/time range. I tried using the TO_DATE PLSQL
> function, but that chops the time portion off my VB date/time
> variable. My ADO looks something like this:
>
> SELECT * FROM tbl
> WHERE
> tbl.CREATED_ON BETWEEN TO_DATE('" & format(dte1, "dd-mmm-yyyy") &
> "') " & _
> "AND TO_DATE('" & format(dte2, "dd-mmm-yyyy") & "')"
>
> my problem is that by formating my visual basic date time variable to
> a format that oracle will accept as input to the TO_DATE function,
> drops the time portion of my variable.
>
> TIA for any help,
> Scott
Received on Fri May 17 2002 - 16:08:37 CEST

Original text of this message