Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ora-01850 hour must be between 0 to 23 .

870213Jun 25 2013 — edited Jun 25 2013

Oracle 10g database

In employee table employee come 25/05/2013 09:39:00AM and go next day 29/05/2013 09:39:00AM .

When I calculate working hours time difference that is 24.0 Hours through this formula

i = in datetime

o= out date time

floor(((o-i)*24*60*60)/3600)
          || ':' ||
        floor((((o-i)*24*60*60) -
     floor(((o-i)*24*60*60)/3600)*3600)/60) WH

after that when i convert working hours into Date  select to_date(wh,'HH24MI')

showing a error ora-01850 hour must be between 0 to 23 .

and in select to_char(wh,'HH24MI') 

showing a error ora-01722 invalid number.

any solution please.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2013
Added on Jun 25 2013
8 comments
2,856 views