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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Query db 1

Status
Not open for further replies.

finnoscar

Technical User
Aug 17, 2002
55
GB
In my db I have three tables Breeder=(BrNo,BrName,BrPhoneNo,BrAddress,BreedName)
Customer=(CNo,CName,CAddress,CPhoneNo)
ProvBooking=(BrNo,CNo,BookingDate)
I want a Breeder to be able enter their BrNo to query the db to see the details of customers who have booked a pup with them,what form should my SQL statement take?
I was thinking along the lines of
SELECT CName,CAddress,CPhone,BookingDate
FROM Customer,ProvBooking
WHERE c.CNo = p.CNo
AND BrNo = "Input by breeder"
Could anyone make any suggestions about how to do this correctly
 
Rather than trying to get your head around SQL try the QBE grid.

CLick View, Design view when looking at the SQL for the query and drag the fields you need onto the grid.

For the criteria try this on the breeder id field

[Enter Breeder ID]

Once you have it working select View, SQL view to see what the SQL looks like

Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top