Using a subquery in a filter

P

PETER

I have a booking database which records bookings for each room in a series of
half hour slots. If a room is booked for an hour there would be two records
- one for each half hour. The current report would show each of these. I
have tried building a query like the one below which I hoped would show a
single result for each room with the initial start time and the final end
time. The problem I am having is with the filter. Can anyone please tell
where I have gone wrong or suggest an alternative method. Thanks in advance.
Peter

SELECT Min([Schedule Details].ScheduleStartTime),
Max([Schedule Details].ScheduleEndTime)
FROM [Schedule Details];
WHERE
ScheduleID=( SELECT DISTINCT[Schedule Details].ScheduleID
FROM [Schedule Details]);
 
R

Rod Plastow

Hi Peter,

Difficult to help you without seeing the layout of your table(s). However I
was surprised not to see a GROUP BY clause in your SQL.

Regards,

Rod
 

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