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

daily schedule for plumber that works several places

Status
Not open for further replies.

munger

Programmer
Feb 28, 2001
23
IL
A plumber works at several schools. We need to make a schedule for him. We have Access Tables for each school including the pipes and sinks, etc.

When I try to make a query that takes from one or more items in each school-Table Access doesn't let me fill in the data complaining that the data is included in another table.

So how is this to be done? An action query with a command botton?

Same question can happen with a veterinary doctor that visits specific animals in several cages.
 
Sounds like you need a few tables, something like
School (SchoolID, SchoolName, etc),
Plumber (PlumberID, PlumberName, etc) and
PlumberAtSchool (PlumberID, SchoolID, StartDateTime, FinishDateTime, etc)

If you are trying to add records to the PlumberAtSchool table you would use an action query, but otherwise you would use a select query, e.g.

select P.PlumberName, S.SchoolName, PAS.StartDateTime, PAS.FinishDateTime from (PlumberAtSchool PAS inner join Plumber P on PAS.PlumberID = P.PlumberID) inner join School S on PAS.SchoolID = S.SchoolID
order by PAS.StartDateTime asc Ben
+61 403 395 052
 
If you have a separate table for each school then you need to normalize your database and eliminate these tables. Using Ben's suggestion will help you do this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top