PC Review


Reply
Thread Tools Rate Thread

Oracle Date and Time

 
 
Jim Heavey
Guest
Posts: n/a
 
      22nd May 2004
I wrote this query to calculate the hours/minutes/seconds between 2 dates.
When I run the query in Oracle using TOAD, all is well, I get what I expect
to see.

When I take the query and use it in the .Net world, my results are
completely different, all the number are negative, rather then positive
numbers and they bear no relation to the values that were displayed when I
run the query in Toad.

Here is a sample of the query...

SELECT ott.YEAR, ott.time_seq,
orc.PDM_CUTOFF_PERIOD,TRUNC(86400*(orc.PDM_CUTOFF_PERIOD-SYSDATE))- 60*
(TRUNC((86400*(orc.PDM_CUTOFF_PERIOD-SYSDATE))/60)) seconds
FROM ops_time_tbl ott, ops_report_Calendar orc WHERE ott.time_type = 'M'
AND ott.time_id = orc.TIME_ID

orc.PDM_CUTOFF_PERIOD is a date such as 6/24/2004.

The above, is just a calculation for seconds, but it caculates Weeks,
Hours, Minutes and seconds. In TOAD they show up something like 4 weeks,
34 days, 8 hours, 24 minutes and 16 seconds.

In the .Net datareader when I read them as dt.GetInt32(3) -- for one field,
such as weeks, it shows -9 and Toad show +4.

Should I not be reading them as Integers? I tried reading it as DateTime,
but that failed.

What might I be doing incorrectly>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting text format of time/date into Excel time/date for subtr YY san. Microsoft Excel Worksheet Functions 5 25th Feb 2010 08:13 AM
Sample Access Database using Oracle Data and needing Time/Date Sta PSULionRP Microsoft Access 0 8th Dec 2009 05:53 PM
Calculating days & time left from start date/time to end date/time =?Utf-8?B?bWFyaWU=?= Microsoft Excel Worksheet Functions 7 7th Dec 2005 03:36 PM
Date/Time datatype in Access 2003 affects date/time duplicate quer =?Utf-8?B?VGltIFQ=?= Microsoft Access Queries 4 27th Jun 2005 03:20 AM
Calc. Length of time with time-in, time-out, date-in, date-out in diff. columns Niceven Microsoft Excel Misc 2 28th May 2004 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.