Home » Developer & Programmer » Forms » Mod and Remainder Numaric function (Developer 6I Database 10g window xp)
Mod and Remainder Numaric function [message #418538] Mon, 17 August 2009 02:31 Go to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Hi All

I want to Calculate overtime so i want the Difference of My out Going Time and The Shift time

For example

If my Out Going Time = 18:45 and
My Shift Time is = 18:30 So i got 15 Min Over time

So How can i Calculate Over time Calculation ?

My Query is

:v_over_time_total_min :=(:Time_out-:TT)*1440;

TT=Shift Time
Time_out = Out going Time

:v_over_time_hour := floor (:v_over_time_total_min/60);
:v_over_time_mins := :v_over_time_total_min - (:v_over_time_hour * 60); 
  :time1 :=:v_over_time_hour || '.' || :v_over_time_mins ;


Time1= Over_time

Now its working Fine when My v_over_time_hours = Not Null and V_over_time_min = Not Null

But when my v_over_time_hours = 0 then Time1 is not coming same as when my V_over_time_min = 0 then time1 is not Coming

For example

When i used Out Going Time = 20.45
And The Shift time =18.30

its given me the Time1=2:15

But when i used out going time=20.10

Its not working

I Hope you guys understand


Regards

Shahzaib ismail
Re: Mod and Remainder Numaric function [message #418539 is a reply to message #418538] Mon, 17 August 2009 02:50 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
I Realized That

:v_over_time_hour := floor (:v_over_time_total_min/60);
:v_over_time_mins := :v_over_time_total_min - (:v_over_time_hour * 60); 
  :time1 :=:v_over_time_hour || '.' || :v_over_time_mins ;


This code is working fine when i Enter manually v_over_time_total_min

When i Enter 15 its show Time1=0:15

But when i used this trigger

:v_over_time_total_min :=(:Time_out-:TT)*1440;


And then used 2nd trigger its give me error trigger raise unhanded exception

Regards

Shahzaib ismail
Re: Mod and Remainder Numaric function [message #418545 is a reply to message #418538] Mon, 17 August 2009 04:20 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
what is the error?
Re: Mod and Remainder Numaric function [message #418547 is a reply to message #418538] Mon, 17 August 2009 04:32 Go to previous messageGo to next message
shahzaib_4vip@hotmail.com
Messages: 410
Registered: December 2008
Location: karachi
Senior Member
Trigger Raise Un handled exception


When i used this
:v_over_time_total_min :=(:Time_out-:TT)*1440;


And then used This

:v_over_time_hour := floor (:v_over_time_total_min/60);
:v_over_time_mins := :v_over_time_total_min - (:v_over_time_hour * 60); 
  :time1 :=:v_over_time_hour || '.' || :v_over_time_mins ;


Its give me error trigger raise un handled exception

But when i manually enter any digit in V_over_time_total_min and used 2nd trigger its work find

For example 1st trigger used its show 15 in V_over_time_hours

And used 2nd trigger its give me error

But when i enter manullay 15 in v_over_time_hours then 2nd trigger work

I dont understand this problem

Regards

Shahzaib ismail
Re: Mod and Remainder Numaric function [message #418575 is a reply to message #418545] Mon, 17 August 2009 07:37 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
cookiemonster wrote on Mon, 17 August 2009 14:50
what is the error?
By
Vamsi
Re: Mod and Remainder Numaric function [message #422615 is a reply to message #418547] Thu, 17 September 2009 21:01 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: Mod and Remainder Numaric function [message #432750 is a reply to message #418538] Thu, 26 November 2009 01:02 Go to previous message
coolbunny111
Messages: 12
Registered: June 2009
Junior Member
You should use built in NVL() function to overcome this problem.
Previous Topic: Custom toolbar in multi-form app
Next Topic: Icons on oracle form6i
Goto Forum:
  


Current Time: Thu Sep 19 23:15:22 CDT 2024