Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display sell details

Status
Not open for further replies.

svoan

Technical User
Nov 30, 2004
2
DE
Hi,

I have a litle problem with a query. I have a database with
Pharmacy(Name, Address, PhoneNO)
Medicine(PCOName, TradeName, Type)
and Sell(PName, PCoName, TradeName, Price)

Sell(PName) references Pharmacy(Name) and Sell(PCoNAme, TradeName) refernces Medicine(PCoNAme, TradeName)

I would like to make a query to find all Pharmacies which are selling the same medicine type (antibiotica) like the pharmacy named pharm1.
But I don't know how I can implement this.

I would be really thankful if anyone can help me in this case.

Thanks

Sven
 

Open the query designer to create a new query. Add the three tables. Drag a link from Medicine (PCoName, TradeName) to Sell (PCoName, TradeName). Then drag a link from Sell(PName) to Pharmacy(Name). Select the columns you want to see in the result.

You should get a query like the following

Select
p.Name, p.Address, p.PhoneNO,
m.Tradename, m.Type, s.Price
From Medicine As m
Inner Join Sell
On m.PCOName=s.PCOName And m.TradeName=s.TradeName
Inner Join Pharmacy As p
On s.PName=p.Name Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top