BradCustom
IS-IT--Management
Hi Everyone,
I'm working on a formula where I could use some help. I'm using Crystal 2008 with a SQL Database.
I'll try and explain what I'm trying to do with this formula.
I have a table called Attendance which has two fields that I'm working with {Attendance.Login} and {Attendance.Logout}. There are of course many employees and 6 different shifts. The Shifts are "DAY6AM", "DAY6:30AM", "DAY7AM", "DAY8AM", "NIGHT3PM", "NIGHT3:30PM" and "NIGHT4PM"
What I'm trying to do is if an employee’s Login time falls within a time range then report it as the start of Shift but if it is outside that range then report the actual login time. I've come up with a formula that works for one condition; I'm having a problem combining the different conditions into one formula.
Below is a formula for an Employee with a Shift of "DAY7AM" and I'm testing the Login time.
Thanks for your help!
I'm working on a formula where I could use some help. I'm using Crystal 2008 with a SQL Database.
I'll try and explain what I'm trying to do with this formula.
I have a table called Attendance which has two fields that I'm working with {Attendance.Login} and {Attendance.Logout}. There are of course many employees and 6 different shifts. The Shifts are "DAY6AM", "DAY6:30AM", "DAY7AM", "DAY8AM", "NIGHT3PM", "NIGHT3:30PM" and "NIGHT4PM"
What I'm trying to do is if an employee’s Login time falls within a time range then report it as the start of Shift but if it is outside that range then report the actual login time. I've come up with a formula that works for one condition; I'm having a problem combining the different conditions into one formula.
Below is a formula for an Employee with a Shift of "DAY7AM" and I'm testing the Login time.
Code:
If {Shift.Shift_Name}= 'Day7AM'
then
(
if ({Attendance.Login}>({Attendance.Work_Date}+.27430556) and
{Attendance.Login}<({Attendance.Work_Date}+.296527778))
then
{Attendance.Work_Date}+ .29166667
else
{Attendance.Login}
)
Thanks for your help!