Three tables for the clock-in application at the hotel.
emp_clock has employees clock in and clock out information.
dept_mast is the master department with the primary key. It has departments like Breakfast, Housekeeping, Laundry, etc.
dept_shift_times has all departments and their ideal clock in time timeframe.
For example, for breakfast department employees, for Mon to Fri, it is from 5:00 am to 5:30 am.
And for Sat and Sun, it is from 6:00 am to 6:30 am.
All times are in short time format with 24 hr time.
For the attendance report of the employees, I wrote a query below, that shows On-time or Late based on their clock-in time.
If their clock-in time falls between their designated timeframe, it's On time, if they clocked in late it's Late.
SELECT emp_clock.emp_no, emp_clock.emp_dept, emp_clock.clin_date, emp_clock.clin_time, emp_clock.clout_date, emp_clock.clout_time, emp_clock.worked_min, Format([clin_date],"ddd") AS Workday,
IIf(
(Format([clin_date],"ddd") In ("Mon","Tue","Wed","Thu","Fri")) And (emp_clock.clin_time<=format(#5:30:0#, "Short time")),"On time",
iif((Format([clin_date],"ddd") In ("Sat","Sun")) And (emp_clock.clin_time<=format(#6:30:0#, "Short time")),"On time", "Late"
)) AS Attendance
FROM emp_clock
WHERE ((emp_clock.emp_dept)="Breakfast");
How do I use the dept_shift_times table with this?
I do not want to include the time directly in the query also.
At this time, I can only think of Union queries for each department with their shifts. And then combine all queries to come up with the result with all the departments.
Again, I will have to find the timeframe for each department (and their shifts and days) and use that in the query.
Please find the small demo file attached. It was created in Access 2019.
Thank you everyone in advance for your time and for sharing the knowledge.
emp_clock has employees clock in and clock out information.
dept_mast is the master department with the primary key. It has departments like Breakfast, Housekeeping, Laundry, etc.
dept_shift_times has all departments and their ideal clock in time timeframe.
For example, for breakfast department employees, for Mon to Fri, it is from 5:00 am to 5:30 am.
And for Sat and Sun, it is from 6:00 am to 6:30 am.
All times are in short time format with 24 hr time.
For the attendance report of the employees, I wrote a query below, that shows On-time or Late based on their clock-in time.
If their clock-in time falls between their designated timeframe, it's On time, if they clocked in late it's Late.
SELECT emp_clock.emp_no, emp_clock.emp_dept, emp_clock.clin_date, emp_clock.clin_time, emp_clock.clout_date, emp_clock.clout_time, emp_clock.worked_min, Format([clin_date],"ddd") AS Workday,
IIf(
(Format([clin_date],"ddd") In ("Mon","Tue","Wed","Thu","Fri")) And (emp_clock.clin_time<=format(#5:30:0#, "Short time")),"On time",
iif((Format([clin_date],"ddd") In ("Sat","Sun")) And (emp_clock.clin_time<=format(#6:30:0#, "Short time")),"On time", "Late"
)) AS Attendance
FROM emp_clock
WHERE ((emp_clock.emp_dept)="Breakfast");
How do I use the dept_shift_times table with this?
I do not want to include the time directly in the query also.
At this time, I can only think of Union queries for each department with their shifts. And then combine all queries to come up with the result with all the departments.
Again, I will have to find the timeframe for each department (and their shifts and days) and use that in the query.
Please find the small demo file attached. It was created in Access 2019.
Thank you everyone in advance for your time and for sharing the knowledge.