RE: Hotel Booking Project Delemma



hi,

you can add the DISTINCT clause in the query serving data to the report.
It omits records that contain duplicate data in the selected fields. To be
included in the results of the query, the values for each field listed in the
SELECT statement must be unique. For example, several employees listed in an
Employees table may have the same last name. If two records contain Smith in
the LastName field, the following SQL statement returns only one record that
contains Smith:
SELECT DISTINCT
LastName
FROM Employees;

If you omit DISTINCT, this query returns both Smith records.

If the SELECT clause contains more than one field, the combination of values
from all fields must be unique for a given record to be included in the
results.

Kind regards,
------
Haris
http://www.manage-systems.com
-----------------------------------------

"Abe" wrote:

> I am having a dilemma with a Hotel Booking Project which is
> a small part of a larger project.
> If someone can help me with this, or refer me to a sample DB
> it would be seriously appreciated!
>
> I have my tables set up as follows.
> tblMembers one to many > tblHotelBookingsToMembers
> tblHotelBookings one to many > tblHotelBookingsToMembers
> (This is setup in the same manner as the Products, Order Details,
> Orders tables in the Northwind DB)
>
> In the tblHotelBookings I have fields to capture Number of Nights,
> & Persons for each booking
> If two members are staying in the same room,
> I book them each individually under the same HotelBooingID
> in tblHotelBookings
> So let's say that HotelBookingID 1001 has 3 Nights & 2 Persons.
>
> Because each member (John & Mary) is linked to HotelBookingID 1001,
> when I try to create a report or query, that sums the number of room nights
> and persons, I get duplicate values. 6 nights & 4 persons
>
> Essentially I am trying to figure out how I can book two Members into
> the same hotel (specific room #s aren't captured) so that each member has
> a booking in my DB and I can design a report that will show the number of
> persons & nights for each booking without duplicates. This info has to be
> passed on to the Hotel.
> Lets see if I can be more clear...
> If one member (John) is booked, but has a second person (i.e. Spouse)
> staying with him who is NOT a Member, then I do NOT need to
> show a booking for that second person in my DB.
> I simply indicate 2 persons. So I only have ONE booking. No problem.
> But if his spouse is a member then I must also book that person into the DB,
> which creates 2 members for the same HotelBookingID
>
> Any advice or help is welcome!
> Thank You!
>
> PS: If more clarity is needed, feel free to indicate so.
>
>
>
.



Relevant Pages

  • Re: Hotel Booking Project Delemma
    ... >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)
  • Hotel Booking Project Delemma
    ... 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: Querying AD for Group information (type/scope)
    ... To Query for Distribution groups: ... To query for all users that have some group other than "Domain Users" ... users with primaryGroupID equal to 513 belong to the "Domain Users" group. ... The reason the member attribute of the "Domain users" and some other ...
    (microsoft.public.windows.server.active_directory)
  • Re: ADAM Subset
    ... Yep this would be a case for an attribute scoped query and as JoeK indicates would require a base level query, ... Joe Richards Microsoft MVP Windows Server Directory Services ... There is a trick called attribute scope query that ADAM supports that allows you to search within the values of a DN-syntax attribute (like member) to filter the results and return attributes on the objects therein. ...
    (microsoft.public.windows.server.active_directory)
  • 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)

Loading