Can a BAM contain multiple tables

mwliquidhappy
Unless I am mistaken, all this can be done except the initial premise.
If I am correct. The time an employee clocks in has nothing to do with the
shift recorded in the laborhed table. That field is defaulted directly from
the shift from the Empbasic table, therefore, they will always be the same
when the laborhed is initially created no matter what time they clock in.
Later, you may change the shift the employee is assigned to and the laborhed
shift would remain at the old shift data and any new records would reflect
the new shift.
Instead, you might consider comparing the LaborHed.ClockInTime to the
JCShift.StartTime and JCShift.EndTime to see if they are within the shift
limits.
Then your BAM for 6.1 might look something like this (forgive any errors as
I am shooting off the cuff and without testing here)

/* Assign the include file */
{ud/GlbAlert.i &TableName = "LaborHed"}
DEFINE BUFFER EmpBasic2 FOR EmpBasic.

/* Find the Shift Hours */
FIND JCShift WHERE JCShift.Company = LaborHed.Company and
JCShift.Shift = LaborHed.Shift NO-LOCK.

IF LaborHed.ClockInTime < JCShift.StartTime and
LaborHed.ClockInTime > JCShift.EndTime THEN DO:

/* Find Employee Details */
FIND EmpBasic WHERE EmpBasic.Company = LaborHed.Company and
EmpBasic.EmpID = LaborHed.EmployeeNum NO-LOCK.

/* Find Supervisor Details */
FIND EmpBasic2 WHERE EmpBasic2.Company = EmpBasic.Company and
EmpBasic2.EmpID = Empbasic.SupervisorID NO-LOCK.

ASSIGN Email-To = string(EmpBasic2.EMailAddress)
Email-Subject = string(EmpBasic.Name) + " was off shift."
Email-Text = string(EmpBasic.Name) + " punched in off the normal
shift. ~n"
+ "Please invistigate the labor entry for " +
string(EmpBasic.FirstName) + " for " string(LaborHed.ClockInDate)
+ " at " + string(LaborHed.DspClockInTime) + ".".

END.
/* If the LaborHed is within shift, no email */
ELSE DO:
RETURN "CANCEL SEND":U.
END.

Good luck,
Aaron Hoyt
Vantage Plastics


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
mwliquidhappy
Sent: Thursday, April 12, 2007 2:27 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Can a BAM contain multiple tables


I am trying to create a BAM that compares the employee's default shift
in the Empbasic table to the shift worked in the laborhed table in
order for it to generate an email to the employees supervisor if they
work anything besides their default shift. Can I reference both of
these tables in a single BAM and can I also define what is in the field
for supervisor's email to be the address used to mail to?

Thanks






[Non-text portions of this message have been removed]
I am trying to create a BAM that compares the employee's default shift
in the Empbasic table to the shift worked in the laborhed table in
order for it to generate an email to the employees supervisor if they
work anything besides their default shift. Can I reference both of
these tables in a single BAM and can I also define what is in the field
for supervisor's email to be the address used to mail to?

Thanks