Friend, in field exist the one time lower and one higher
which corresponds to the entry and departure from the employee, I need to separate by date and employee
and insert in another table (for example).
Okay, it shouldn't be too hard. Here are the steps:
1. Add the three fields to your query.
2. The alias for EndTime will be:
Code:
EndTime: (SELECT Q.StartTime FROM TableName WHERE Q.EmployeeID = TableName.EmployeeID AND Q.[Date] = TableName.[Date] AND Q.StartTime > TableName.StartTime)
3. Finally, put NOT IS NULL under this alias, EndTime criteria.
NB: Change TableName to be the table you're using. Remember you shouldn't be using Date as a field name because it is a reserved keyword. If you continue like this you must enclose Date in square brackets (like I've done).