Home » Developer & Programmer » Forms » how to calculate time
how to calculate time [message #86907] Fri, 19 November 2004 02:48 Go to next message
annu
Messages: 34
Registered: February 2002
Member
i m developing a time managment system .. for that i need some assistance .. in my physical system all the employies are punch there time cards for in and out. i want to record there timings .. i have three shifts in a day, total 8 hours in one shift.. 9:00 am to 17:00 pm , 17:00pm to 1:00am and 1:00am to 9:00am .. in this sitation some employes do overtime also. and u can easily see that there is a change of date also in one day . now i have to ask some questions.

let suppose i have a data like this

master
trans_date
01-jun-2004

detail
empno time_in time_out tot_hours ot_hours
101 09:00am 17:00pm 8.00 0.00
102 09:00am 18:30pm 8.00 1.50
103 17:00pm 13:00pm 12.00 4.00


1. what kind of a data type i store in forms 6i char or time ?.
2. what kind of a data type i store in table field data type varchar2 or date?
3. should i must record date also with time recording in detail table . or just time is enough.
4. how can i obtain total hours ? confusion in calculating time differnece in forms.
5. what do u suggust that i use formula calculation or triggure base calculation technique to calculate tot_hours and ot_hours.(is there any way to use item formula calculation mode to calculate time difference in forms)
6. what is the best triggure for this condition while use enter in and out timing and automatically ot_hours and tot_hours calculation display in forms.

hope so that everyone can easily understand what is my problem is .. kindy suggest me with your great ideas.. it is also appricaiable that anyone who give me reference link about time management system to understand it in better way ..

best regard

Annu
Re: how to calculate time [message #86962 is a reply to message #86907] Wed, 24 November 2004 04:27 Go to previous message
rama krishna
Messages: 97
Registered: December 2001
Member
1. what kind of a data type i store in forms 6i char or time ?.

Ans : DATETIME

2. what kind of a data type i store in table field data type varchar2 or date?
Ans : DATE

3. should i must record date also with time recording in detail table . or just time is enough.

Both Date & Time

4. how can i obtain total hours ? confusion in calculating time differnece in forms.

Direct END_DATE minus START_DATE (Oracle is intelligent enough to calculate difference btw two dates upto seconds)..But u need to some calculations like Multiply by 24 so on and so forth according to ur requirement

5. what do u suggust that i use formula calculation or triggure base calculation technique to calculate tot_hours and ot_hours.(is there any way to use item formula calculation mode to calculate time difference in forms)

6. what is the best triggure for this condition while use enter in and out timing and automatically ot_hours and tot_hours calculation display in forms.

Ans : There is a property in forms for Items where u can calculate the value for an item based on Formula..
go thru all the Properties of Item u'll be able to get that...
Calculation Mode set it a s Formula..
give formula as (:out_time - :in_date) * 24 gives u No.of Hours worked ...u can calculate OT for this..

Hope u understood the Answers given by me..

Cheers
Ram
Previous Topic: Installing Forms 6i on Windows XP
Next Topic: query question
Goto Forum:
  


Current Time: Sat Sep 07 15:48:32 CDT 2024