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!

Adding minutes to date

2850037Feb 2 2015 — edited Feb 2 2015

Hello Team,

We have requirement to add hours/minutes to the given date in stored procedure. 

We have a table Master , in this we have duration type ( define type of duration like hours , minutes , weeks etc. ) and duration units ( like 24 , 30 etc.) ...

Like  Type hours and unit is 24 ..means 24 hours and minutes 30 ....etc..

We have a table a child table in that we have dates ...when we execute the procedure we need to add duration from mater table in to date of child table like..

variable -

calculated_date = 1/22/2015 11:16 + 24 hours  > should be 1/23/2015 11:16

or

calculated_date = 1/21/2015 15:23 + 30 minuets  > should be 1/21/2015 15:53

etc...


Any idea how to do it ?



    Master

DURATION_TYPEDURATION_UNITS
HOURS24
MINUTES30
MINUTES40
MINUTES50
MINUTES45

Child

   

DATE
1/22/2015 11:16
1/21/2015 15:22
1/02/2015 15:20
1/22/2015 15:19
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2015
Added on Feb 2 2015
12 comments
2,899 views