|
Tom
Here's a computed column I use successfully to compute MINUTES
elapsed, rounded off to the nearest whole number:
TIMESTART TIME
TIMEEND TIME
MINUTES INTEGER = ((TimeEnd-TimeStart) / 60))
ZERO is OFF in this database
----- Original Message -----
From: John Engwer
Sent: Sunday, July 10, 2005 11:14 PM
Subject: [RBG7-L] - RE: Time calculations Tom, here is some code
that I use in an EEP to allow employees to check in and out. It works like
a time clock. The table that I use to
collect time in and time out data is called Time_Track . It contains the
employee number, time_in, time_out and a field that contains their allotted
lunch time. (data type for time_in & time_out is
DateTime) I have a check in and
check out button on a form. The employee clicks on the appropriate
button and enters their employee number and the code does the
rest. --Check Out
EEP SET VAR vio TEXT =
NULL SET VAR vlunch_adj REAL
= 0 SET VAR vlunch REAL =
0 SET VAR ilunch_adj
INTEGER SET VAR itot_hrs
INTEGER SET VAR ilunch
INTEGER --check to see if
employee is checked in SELECT checked_in INTO
vio FROM employee WHERE emp_number = .vemp_no IF vio = 'O'
THEN PROPERTY
idcontinue visible 'FALSE' PAUSE 2 USING
'You are already checked out!' CAPTION '"CHECK OUT" ERROR'
+ icon serious
button 'Please CANCEL to continue' ELSE UPDATE employee
SET checked_in = 'O' WHERE emp_number = .vemp_no UPDATE
time_track SET time_out = .vdate_n_time, + tot_hours
=(brnd(((time_out-time_in)/3600),4,.1)), + lunch_adj = 0
+ WHERE emp_number
= .vemp_no AND time_out IS NULL ENDIF SELECT
SUM(lunch_adj),SUM(tot_hours) + INTO vlunch_adj
INDICATOR ilunch_adj,vtot_hrs INDICATOR itot_hrs + FROM time_track
+ WHERE emp_number =
.vemp_no AND (DEXTRACT(time_in)) = .#DATE SELECT lunch INTO
vlunch INDICATOR ilunch FROM employee + WHERE emp_number =
.vemp_no IF vtot_hrs >= 6 AND
vlunch_adj = 0 THEN UPDATE
time_track SET lunch_adj = .vlunch + WHERE emp_number
= .vemp_no + AND
(DEXTRACT(time_in)) = .#DATE + AND COUNT =
LAST ENDIF CLEAR VAR
vio,vemp_no,vlunch,vlunch_adj,ilunch_adj,itot_hrs,ilunch RETURN John
Engwer From:
I am making a table to keep track of employees
time. I have timein and timeout and a calculated column of
totaltime. When i enter times the calculated column remains null.
This is probably something very simple, but any help would be
appreciated Tom
Hart |
