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_TYPE | DURATION_UNITS |
| HOURS | 24 |
| MINUTES | 30 |
| MINUTES | 40 |
| MINUTES | 50 |
| MINUTES | 45 |
Child
| DATE |
| 1/22/2015 11:16 |
| 1/21/2015 15:22 |
| 1/02/2015 15:20 |
| 1/22/2015 15:19 |