-
[RESOLVED] Query Help
I am working on a program to read in Timestamps from an Oracle DB and check how long transactions are taking by subtracting the Timestamps.
The DB is setup so that when a transaction starts an entry is made into the DB with a MsgID, Timestamp, "START" then when it completes a new record is made MsgID, Timestamp, "END". Thanks to RhinoBull I have figured out how to read the Oracle Timestamps into VB but it seems no Microsoft products can perform date functions on these due to the format containing sub-seconds: 14-JUL-10 03.01.48.483624 AM.
I know I could break those down into various pieces then compare each piece and put the result back together but that is a real PITA. Is there a way to query the DB to return both Timestamps AND the difference between them as part of a SINGLE record?
-
Re: Query Help
this is a specific oracle database question and would be better in the database forum
i would believe that oracle should be able to return the value you want, to some level of precision
-
Re: Query Help
Hi,
Yes... Try This :
SELECT Date1, Date2, ((Date1 – Date2)*24*60*60) as MySeconds From MyTable
Regards
Veena
-
Re: Query Help
I ended up just pulling the sub-second portion of the Time stamp out and using the DateDiff to get the seconds, then subtracting the sub-second and then adding the answers together. A bit more work but works perfectly. Thanks for the answers guys, marking as Resolved.