Problem with a query

A

Aleksei

Hi!
I have a db of the hotel. Hotel can provide different services, and the
client can use different services (1 and more). Each service has its price.
So i have the following tables:
1) ID
Client
ServiceName
Date
2) ServiceID
ServiceName
Price
I need a query that will show client and total cost of services he used - is
it possible?

Thanks in avance for the answer!
 
J

Jeff Boyce

Aleksei

I suspect that you have a many-to-many relationship. Each Client can have
one-to-many Services, but each Service can have one-to-many Clients. To
manage this, you need a third table, a resolver/junction/relation table
(?trelClientService) that holds one row for each valid combination of Client
and Service. This third table is where you record who has what service.

You'd use a query that joined this third table back to the other two to get
the ClientName and the ServicePrice.
 

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

Similar Threads

Problem with a query 1
query results show in form 1
Trouble with getting a distinct count 1
Append Query with VBA and SQL 1
Pop-up Box with a reminder 1
Query help needed 1
Combo Box Query! 5
Query help! 1

Top