Re: Date Difference
Date: Wed, 1 Feb 1995 23:13:50 GMT
Message-ID: <D3CGJ5.rK_at_gremlin.nrtc.northrop.com>
In article <3g5tm2$q2c_at_portal.gmu.edu> agandhi_at_osf1.gmu.edu (Ajay M Gandhi) writes:
>Mike D. Resnick (mresnick_at_world.nad.northrop.com) wrote:
>: In article <3f4arp$f0e_at_crchha60.bnr.ca> bartok_at_bnr.ca (Vince Cross) writes:
>: >In article <3f42cq$3un_at_portal.gmu.edu>,
[ C H O M P ]
>
>Another angle:
>
> For Example : End_date = '12-JAN-1995-02:30:00'
>and Start_date = '11-JAN-1995-03:30:00'
>
>Now we apply the above select clause, then we get the hour difference as '-1'.
>which is not what I had asked for.
Another way to do this is to have oracle give you the number of seconds
between the two dates. The following will give you the total seconds:
SQL> select (to_char(end_dt,'j')-to_char(start_dt,'j'))*86400 2 +to_char(end_dt,'sssss') -to_char(start_dt,'sssss') from date_table; DIFF
82800
You could then convert this to a date format. Oracle will only convert up 99999 seconds (27.77 hours) using the date function, so you may have to have some other routine to do it. See ya - MR.
>
>Anyway thanks for replying back.
>
>Ajay
>SIRC
>: Hope this helps - MR
>: >
>: >Enjoy,
>: >Vince
>--
>*******************************************************************
>SIRC => Software Information Resource Corp. - Meeting Future Needs
>*******************************************************************
_ _ |\ | _ ._ _|_ |_ ._ _ ._ /__ ._ ._ _ ._ _ _.._ / _ ._ _ | \|(_)| |_ | || (_)|_) \_| | |_|| | || | |(_|| | \_(_)| |_). /--------------------------|---.----------------------------------|----------\ | Michael D. Resnick | mresnick_at_world.nad.northrop.com | | Northrop Grumman Corporation | Voice: 310.332.7807 | | Military Aircraft - ILS LIS | Fax: 310.332.7816 | | One Northrop Ave. 2555/W6 |---------------------------------------------| | Hawthorne, CA 90250 | "Someday I'll quote myself and put it here" | \------------------------------^---------------------------------------------/Received on Thu Feb 02 1995 - 00:13:50 CET