• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Oracle Date Difference

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys..
I need ur help...
I am having 2 dates ..in the normal oracle date format
Now i want to substract the two dates by only comsidering their hh24:mi:ss format
i.e., '24-jan-2004 20:00:00' - '27-jan-2004 25:00:00' shud give me 05:00:00 ... i.e.,Only the difference in their times shud be the output...i know its unusual requirement..but cant help it...

waiting for ur replies..
regards,
Nischal
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like in the other thread you had, you need to convert to Date using the to_number() or to_char() data type and do your math there. These functions allow you to specify the format or part of the Date/Time that you want to be able to do your calculations. Remember though, that after you convert your dates, subtraction will loop around 100, and not at 24 or 60.
I think you should visit Ask Tom and do a search, I guarantee you will find an answer there that is the best answer.
Mark
 
reply
    Bookmark Topic Watch Topic
  • New Topic