Help with timesheet query

  • Thread starter Thread starter Leanne
  • Start date Start date
L

Leanne

I've been asked to create a query that will allow the supervisor to
find all employees working between given times. So far, using Between,
I've been able to find all whose start time is during the set
parameters and whose end time is during them also. What I can't figure
out how to do is get the names of those who are working during the
given parameters, but actually start before
or those who start working during the given times, but stop after.

For example:

Selected time range: 10am - 2pm

How do I get it to give me someone who actually starts at 8am but
finished at 1pm or someone who starts at 11am but finished at 3pm?

I'm not sure I've explained this well, but any help would be
appreciated.

Thanks.
 
Try a where condition like:
WHERE [StartTime] < Forms!frmTimes!txtEndTime AND
[EndTime]>Forms!frmTimes!txtStartTime
 
That was just the thing! Thanks.

Try a where condition like:
WHERE [StartTime] < Forms!frmTimes!txtEndTime AND
[EndTime]>Forms!frmTimes!txtStartTime

--
Duane Hookom
Microsoft Access MVP



Leanne said:
I've been asked to create a query that will allow the supervisor to
find all employees working between given times. So far, using Between,
I've been able to find all whose start time is during the set
parameters and whose end time is during them also. What I can't figure
out how to do is get the names of those who are working during the
given parameters, but actually start before
or those who start working during the given times, but stop after.
For example:
Selected time range: 10am - 2pm
How do I get it to give me someone who actually starts at 8am but
finished at 1pm or someone who starts at 11am but finished at 3pm?
I'm not sure I've explained this well, but any help would be
appreciated.
Thanks.- Hide quoted text -

- Show quoted text -
 
Back
Top