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

Select query form a table and List

Status
Not open for further replies.

johnrg1

Programmer
Jan 24, 2003
38
0
0
GB
Hi All,

I am trying to find a way to use a stored procedure to filter out the records i do not want rather than in my program.

I have a list of shifts that are linked to a piece of equiptment, which has an equiptmentID.

I have a table that links workerID's to what equiptment they can work.

I can query the shifts table and select shifts between 2 given dates. within this query the SquiptmentID is obtained.
Is there a way for me to add the workerID into the same SP and have it remove all the entries where the equiptmentID is not linked to the staffID?

I imagine this might sound confusing, but any help will be very welcome.

Thanks

John
 
Create a view that combine the workers table, the shifts table, and the equipment table. Link the equipment to shifts by the shiftID. Link the workers to the equipment table by equipmentID AND the shiftID. This should give you a view that will list all combinations of workers, shifts, and equipment. I assume that you are trying to get a list that can be used to schedule the workers, which this view should give you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top