G
Guest
I have two tables, a personnel table that list all the people that work in my
group, and an unavailable table that lists when personnel are away from the
office. The unavailable table uses the personnel ID field and has a start
time and end time to when they will be unavailable. I need to populate a
combo box with the names of people who are available for watch. I tried to
run a MINUS query in ACCESS 2000 like below,
SELECT [Personnel].[ID]
FROM Personnel
WHERE Personnel.CDO=True
MINUS
SELECT Unavailability.ID
FROM Unavailability
WHERE (Unavailability.[Start Date]<=[Date]) AND (Unavailability.[End
Date]>=[Date]);
But I keep getting a syntax error. I cannot find the error. I also tried
running a join that discards the ID’s I do not need like below,
SELECT Personnel.ID, Personnel.RANK, Personnel.NAME
FROM Personnel LEFT JOIN [Unavailable List by date] ON Personnel.ID <>
[Unavailable List by date].ID
WHERE (((Personnel.CDO)=True))
ORDER BY Personnel.GRADE DESC , Personnel.NAME;
Where the Unavailable List by date query lists the people not available on a
particular date, but I get garbled results. Specifically, I get the names of
everyone in the personnel table listed 5 times.
Help. How do I create a query that returns results that do not include
people that are not available?
group, and an unavailable table that lists when personnel are away from the
office. The unavailable table uses the personnel ID field and has a start
time and end time to when they will be unavailable. I need to populate a
combo box with the names of people who are available for watch. I tried to
run a MINUS query in ACCESS 2000 like below,
SELECT [Personnel].[ID]
FROM Personnel
WHERE Personnel.CDO=True
MINUS
SELECT Unavailability.ID
FROM Unavailability
WHERE (Unavailability.[Start Date]<=[Date]) AND (Unavailability.[End
Date]>=[Date]);
But I keep getting a syntax error. I cannot find the error. I also tried
running a join that discards the ID’s I do not need like below,
SELECT Personnel.ID, Personnel.RANK, Personnel.NAME
FROM Personnel LEFT JOIN [Unavailable List by date] ON Personnel.ID <>
[Unavailable List by date].ID
WHERE (((Personnel.CDO)=True))
ORDER BY Personnel.GRADE DESC , Personnel.NAME;
Where the Unavailable List by date query lists the people not available on a
particular date, but I get garbled results. Specifically, I get the names of
everyone in the personnel table listed 5 times.
Help. How do I create a query that returns results that do not include
people that are not available?