DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: date help

Threaded View

  1. #1
    Join Date
    Jun 2008
    Posts
    38

    date help

    i have a table called std_detail.I m geting the max and min date from the table and then finding the difference b/w dates:

    ENAME TIME_VALUE
    naveed 09/10/2008 08:30:50
    amit 10/30/2008 00:00:00
    raja 11/17/2008 03:30:50
    fasi 10/25/2008 01:30:50
    yuvi 06/27/2008 17:55:06
    -----------------------------------------------

    select
    (select to_char(max(time_value),'dd/mm/RR HH:MI:SS') from std_detail) -
    (select to_char(min(time_value),'dd/mm/RR HH:MI:SS') from std_detail) "Days diff"
    from dual

    -----------------------------------------------------------------

    the above command not working showing ORA-01722.



    --------------------------------------------------------------------------
    if i use this sql :

    select
    (select to_date(max(time_value),'dd/mm/yyyy hh:mi:ss') from std_detail) -
    (select to_date(min(time_value),'dd/mm/yyyy hh:mi:ss') from std_detail) "Days diff"
    from DUAL


    above sql gives only the date diff but not the hour min diff alongside date
    Last edited by ali560045; 07-01-2008 at 06:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width