Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle Dates and ADO

Re: Oracle Dates and ADO

From: Thomas <T_at_T>
Date: Tue, 1 Apr 2003 12:54:58 -0500
Message-ID: <3e89d272$2@rutgers.edu>


Are you using a connection object to execute the query? If you're just trying to display the date, and you're using a connection object to execute an SQL to a recordset, you could use the to_char function in your query.

You didn't say what you're developing with (VB, ASP/JScript, ASP/VBScript, etc). If you're using VB6, the adDate, adDBDate, adDBTime, and adDBTimeStamp all translate into VB's Date type. So just format the VB date type... an example would be:

Dim sMyDateFormat As String
sMyDateFormat = "dddd, mm/dd/yyyy, hh:mm AM/PM" Print #iMyReport, "This report was generated at " & Format(Date, sTimeFormat)

You should be able to pop "mytape.mydatetimefield.value" in place of "Date" in the last line. I seem to remember reading recently somewhere that if you don't use formatting, you get the default format, which is the hour and minutes. I can't seem to find where I read that, though.

Good luck, let us know how it goes. As regards Visual Studio, not many people talk about using date fields in their books or online articles; it seems like everybody avoids them. OLEDB handles the DBTIMESTAMP very nicely; you can read and set the
.day/.fraction/.hour/.minute/.month/.second/.year members.

-T

"Chad" <chad.dokmanovich_at_unisys.com> wrote in message news:b55b9g$3at$1_at_trsvr.tr.unisys.com...
> We have a field in a table that is declared as a datetime field. There is
> one record in the table. The value of this field is:
> 2 04:52:26
>
> meaning 2 days, 4 hours, 52 minutes, and 26 seconds
>
>
>
> When this field's value is queried, ADO displays the value as 4:52.
>
> Any suggestions on how to get the actual value?
>
>
>
>
Received on Tue Apr 01 2003 - 11:54:58 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US