
?Oracle Date/Time and RDO/ODBC
Quote:
> It seems that one of my requirements is to match rows whose key is, in
> part, a date/time data type. I am aware that if the implementation of
> this data item is floating point with the whole number for days and
> the fraction for time, this task is in trouble.
> Just what is the RDO/ODBC role in this jigsaw?
> when I pass a date 04-aug-1997 11:23:17 what happens to this value on
> the way to Oracle?
> Anyone happen to know the Oracle details?
> Suggestions or workarrounds are most welcome.
I don't know how Oracle stores date/times, but DAO and I think
RDO want to deal with them as floating point. That's trouble
because if I remember correctly Oracle's date/times can track
fractions of a second while VB can't. If you have a date/time and
you need to find a matching Oracle record, try something like
this: (The SQL is in DAO format, but it shouldn't be hard to
convert)
Const JetDateTimeFmt = "\#mm\/dd\/yyyy hh\:nn\:ss AM/PM\#;;;\N\U\L\L"
SQL = "select mytable.* from mytable where mytable.mydatetime >= "
SQL = SQL & Format$(DateToFind, JetDateTimeFmt)
SQL = SQL & " and mytable.mydatetime < "
SQL = SQL & Format$(DateAdd("s", 1, DateToFind), JetDateTimeFmt)
This may return multiple records, but they'll all be within the
same second you're looking for. I almost used a BETWEEN clause,
but that would have included any records with a date/time field
containing exactly the next second after the one you want.
--
WARNING: I cannot be held responsible for the above They're coming to
because my cats have apparently learned to type. take me away, ha ha!