Dates

J

J P Singh

I have a table in access where I store the dates that our employees have
booked off as holidays.

I want to run a query to find out which employees have not booked 29th -
31st Dec as their day off.

Can this be done?

The table structure is

EmpNumber
DateFrom
DateTo

Thanks in advance
 
C

Craig Ison

Select empnumber from [youremployetable] where not empnumber in (select
datefrom >= 12/29/2003 and dateto <= 12/31/2003)

hope this helps
 
C

Craig Ison

sorry correction

Select empnumber from [youremployetable] where not empnumber in (select
empnumber from holidaytable where datefrom >= 12/29/2003 and dateto <=
12/31/2003)

hope this helps
 
J

J P Singh

Hi Craig

I didn't get the question right.

There are two tables

Employee Profile which has empnumber, firstname, lastname etc...

HolidayRequests which has empnumber, datefrom, dateto

I guess the the solution below will only work for people who have booked any
holiday at all.




Craig Ison said:
sorry correction

Select empnumber from [youremployetable] where not empnumber in (select
empnumber from holidaytable where datefrom >= 12/29/2003 and dateto <=
12/31/2003)

hope this helps

J P Singh said:
I have a table in access where I store the dates that our employees have
booked off as holidays.

I want to run a query to find out which employees have not booked 29th -
31st Dec as their day off.

Can this be done?

The table structure is

EmpNumber
DateFrom
DateTo

Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top