calculate the time [message #338795] |
Tue, 05 August 2008 23:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sajidrazmi
Messages: 47 Registered: August 2008 Location: oman
|
Member |
|
|
Dear All I am getting a problem in forms
if i have a vlue 298 how to i convert in hours and minute just like this
298 = 5:58 hrs
i am doing in form 6i
or
one problem is i have one column in_time (value 08:00 AM) and second column out_time (value 01:10 PM) i have to calculate how much hours in between .
so please help me out of this problem
thanks in advance
[Updated on: Tue, 05 August 2008 23:35] Report message to a moderator
|
|
|
|
Re: calculate the time [message #338822 is a reply to message #338809] |
Wed, 06 August 2008 01:02 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sajidrazmi
Messages: 47 Registered: August 2008 Location: oman
|
Member |
|
|
HI
i have two colums in a block tas_temp_post_lunch_in, and second one is tas_temp_evening_out in this column in value is 08:00 AM
and out_value is 12:58 PM i have to calculate in between the hours i have written code for this
if i write this code the value come 4.81 but excat value is 4.58
:blk_tas_temp.tas_temp_tot_evening:=(to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM')-to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM'))*24 ;
and if i write this
:blk_tas_temp.tas_temp_tot_evening:=(to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM')-to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM'))*24*60 ;
then value come 298
i need 4.58 value
how it come please tell or write code
thanks
[Updated on: Wed, 06 August 2008 01:04] Report message to a moderator
|
|
|
|
Re: calculate the time [message #338840 is a reply to message #338795] |
Wed, 06 August 2008 01:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
gurupatham
Messages: 66 Registered: March 2008 Location: Chennai
|
Member |
|
|
Extract hour and second separately like below
nhour:=trunc((to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM')-to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM'))*24) ;
nSec:=(to_date(to_char(to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM') , 'MI') , 'MI')
-to_date(to_char(to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM') , 'MI' ) , 'MI'))*24*60 ;
|
|
|
Re: calculate the time [message #338884 is a reply to message #338795] |
Wed, 06 August 2008 03:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sajidrazmi
Messages: 47 Registered: August 2008 Location: oman
|
Member |
|
|
hi dear if i am doing this it giving me seperate result
how i could assign in one column because
it is giving in hrs 4:00
how i have to add
and minutes 1:00
total is 4:01
please tell me
thanks
|
|
|
|
Re: calculate the time [message #338995 is a reply to message #338893] |
Wed, 06 August 2008 07:16 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sajidrazmi
Messages: 47 Registered: August 2008 Location: oman
|
Member |
|
|
HI
DEAR WHEN I AM DOING THIS ERROR IS COMING STATEMENT IGNORED.
TEMPH:=trunc((to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM')-to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM'))*24) ;
TEMPS:=(to_date(to_char(to_date(:blk_tas_temp.tas_temp_evening_out,'HH:MI AM') , 'MI') , 'MI')
-to_date(to_char(to_date(:blk_tas_temp.tas_temp_post_lunch_in,'HH:MI AM') , 'MI' ) , 'MI'))*24*60 ;
:BLK_TAS_TEMP.TAS_TEMP_TOT_EVENING := TO_DATE(TEMPH||':'|| TEMPS,'HH:MI PM');
|
|
|
|