I'm in the process of planning out a database that can organise our staff bookings. Basically having the ability to link staff to certain clients at chosen periods of time.
For example StaffMemberA may be booked to with ClientA on 01/01/09 from 08:00 to 20:00. This data could be held in the table tbBookings with Primary keys StaffMemberName and Date.
What i want the program to do is to tell the user if StaffMemberA is already booked in the time selected. This could be done by looking at tbBookings to see if StaffMemberA with Date is there. But how do i relay that StaffMember is available from 00:00 to 08:00 or 20:00 to 00:00. In other words tell what hours StaffMemberA can be booked so that a double booking does not arise.
I was planning to create a new table from any bookings made that hold the Date, StaffMemberName and a Boolean field for each time segment from 00:00 to 00:30 and so on till 24:30. So the program can look at this table to tell if a StaffMember is available on any given day. But I thought there must be an easier way to do this rather than creating a whole new table.
Any help or suggestions are welcome. Thanks
For example StaffMemberA may be booked to with ClientA on 01/01/09 from 08:00 to 20:00. This data could be held in the table tbBookings with Primary keys StaffMemberName and Date.
What i want the program to do is to tell the user if StaffMemberA is already booked in the time selected. This could be done by looking at tbBookings to see if StaffMemberA with Date is there. But how do i relay that StaffMember is available from 00:00 to 08:00 or 20:00 to 00:00. In other words tell what hours StaffMemberA can be booked so that a double booking does not arise.
I was planning to create a new table from any bookings made that hold the Date, StaffMemberName and a Boolean field for each time segment from 00:00 to 00:30 and so on till 24:30. So the program can look at this table to tell if a StaffMember is available on any given day. But I thought there must be an easier way to do this rather than creating a whole new table.
Any help or suggestions are welcome. Thanks
Comment