‎2007 Aug 29 8:37 AM
Hi,
I have a data where time is displayed in HH:MM format. Is there any function which can read the in separate Hour and minutes so as to convert into number of days?
‎2007 Aug 29 8:41 AM
‎2007 Aug 29 8:45 AM
divide the MM portion by 60 and add to HH portion.u'll get total no of hours..den use da simple logic:
no. of days =(1/24) * total hours
plz reward points if it helps
‎2007 Aug 29 8:50 AM
Hi Nilesh,
let is say your variable is l_time which holds time in the format of HH:MM.
save this l_time to some variable of numerical character type first,
then get the hours and minutes into seperate variables like shown below,
l_char_time = l_time.
l_hours = l_char_time+0(2).
l_min = l_char_time+2(2).
number_of_days = ( l_hours + ( l_min / 60 ) ) / 24.
there you have the number of days,
Note: l_hours, l_min, number_of_days & l_char_time are of type N.
<b>Reward points if this helps,</b>
Kiran
‎2007 Aug 29 9:03 AM
Hi,
can you give more explation of ur reqr........
u want to conver the number of hours to days ?
Regards,
Vijay
‎2007 Aug 29 9:37 AM
Hi let me explain the requirment
Data is say 30 : 20 i.e 30 hours and 20 minutes.
I need to separate 30 and 20. Convert it into either minutes as 30*60 +20
or in hours 30 + 20/60 = 30.33 Hrs.
How could I separate this two?
‎2007 Aug 29 9:46 AM
move ztime to zchar.
split zchar at ':' into zstr1 zstr2.
replace ':' in zstr1 with space.
zint1 = zstr1.
zint2 = zstr2.
den carry out calculations on zint1 and zint2.
plz reward points if it helps