Microsoft Access 2010 - Timesheet database Catch overlap time entries except for
Posted on 2013-11-29
I have a database that employees enter their time on a certain project and it will warn them if they submit the time and it overlaps the time on another project. For example I enter 7/29/2013 7:00 AM start time and enter 7/29/2013 8:00 AM stop time. Then on another project I enter 7/29/2013 7:50 AM start time and enter 7/29/2013 9:00 AM it is a conflict. (7:50 to 8:00) Works great no issues. Now they want to be able to enter start time 7/29/2013 8:00 AM and stop time 7/29/2013 9:00 AM and this not being a conflict. What is the best way to handle this.
Here is the current query.
SELECT tbltimesheet.EventID, tblEvent_1.EmpName, tbltimesheet.LocationID, tbltimesheet.Starttime, tbltimesheet.Stoptime, tbltimesheet.Sel, tbltimesheet.systemnotesid
FROM tbltimesheet INNER JOIN tbltimesheet AS tblEvent_1 ON tbltimesheet.EmpName = tblEvent_1.EmpName
WHERE (((tblEvent_1.EmpName)=networkusername()) AND ((([tblEvent_1].[Starttime]>=[tbltimesheet].[StopTIme]) Or ([tblEvent_1].[StopTime]<=[tbltimesheet].[Starttime]) Or ([tbltimesheet].[EventID]=[tblEvent_1].[EventID]))=0))
ORDER BY tbltimesheet.Starttime;
Thanks for all the help.