SQL Help

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

I have a table named Booking and another called Events

A booking can have multiple events tied into it.

Here is what my query results look like:

EventID BookingID BookingName EventDesc
StartDate EndDate
200 101 SQL Event Breakfast 6/16/09 9:00:00
AM 6/16/09 10:00:00 AM
200 101 SQL Event Breakfast 6/16/09 9:00:00
AM 6/16/09 10:00:00 AM 200 101 SQL Event
Breakfast 6/16/09 9:00:00 AM 6/16/09 10:00:00 AM

Here is my SQL query

SELECT dbo.Event.EventID, dbo.Booking.BookingID,
dbo.Booking.BookingName, dbo.Event.EventDesc, dbo.Event.StartDate,
dbo.Event.EndDate
FROM dbo.Event INNER JOIN dbo.Booking ON dbo.Event.BookingID =
dbo.Booking.BookingID
WHERE (dbo. Booking.BookingID = 101)

Even though there are three events tied to this booking, I would like
to show just one record of the event showing.

For example, I would like to produce:

EventID BookingID BookingName
StartDate EndDate
200 101 SQL Event 6/16/09 9:00:00 AM
6/16/09 6:00:00 PM

Thus, the Event shows up one time in my query and only shows the
earliest start date and latest end date instead of all events.

Is this possible?

Thanks so much for any time and thoughts in advance!
.



Relevant Pages

  • Re: Help With 3 Queries Please...
    ... Basically for the invoices question I want to user to open the query ... The user enters a booking ID ... the number of dogs boarded question even I don't have a clue ... I do have one final question: If I was to create a report based on ...
    (microsoft.public.access.queries)
  • Re: Urgent Help Required
    ... FROM Driver, Booking ... hotels in London and then write a query that uses that as input to get the ... Average per hotel. ... "Running Microsoft Access 2000" ...
    (microsoft.public.access.queries)
  • RE: Hotel Booking Project Delemma
    ... you can add the DISTINCT clause in the query serving data to the report. ... > I am having a dilemma with a Hotel Booking Project which is ... > In the tblHotelBookings I have fields to capture Number of Nights, ... > If one member is booked, but has a second person ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Hidding or record
    ... The query on which this form is based, if also updated by another form. ... black-out dates during the booking process. ... thanx, paul ... > What is the process by which you want to "store changing data" into this ...
    (microsoft.public.access.forms)
  • Re: SQL subquery problem - bookings database
    ... > Many thanks for your suggestion. ... > HOWEVER, when I run it, I get a "Data type mismatch in criteria ... > which is giving the error "You tried to execute a query that does not ... >> moment is the booking ...
    (microsoft.public.access.queries)