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!

Block Query

Status
Not open for further replies.

ERTW

Programmer
Feb 22, 2001
3
CA
Hi there!

I have a query which left joins a table and five other queries. I have to write a similar query for 19 other tables.

Is there any way I can write the five queries directly as subqueries so i don't have to make 6x19= 114 query files.

If not, would it be possible to reuse those same queries for the other tables with perhaps a form, where I can enter the name of the table I want the queries run on?

If also not possible, here is my situation:

I have a table comprising courses and its times, currently in the form

course monday start time monday end time ....
xxxx 123 8.0 9.0 ....
xxxx 333 ... ... ....
.......

I would like to place the information into a timetable
with the following format:

time monday tuesday wednesday .....
8.0 xxxx 123 xxxx 333 xxxx 123
8.5 xxxx 123 xxxx 333 xxxx 123 ......
9.0 xxxx 303 ......
.
.
.
22.0

currently, I have created 5 queries that extracts the time and the course for a particular day...

for monday:
time course
8.0 xxxx 123
etc.

when i put it all together, I write a query that left joins an empty timetable ( so I get all the hours, 8.0 - 22.0)with the 5 queries ( one for each day ).

only thing now is, I have to do the same thing to 19 other course tables and I'd prefer not to make 114 ridiculous queries. Isn't there a way I can combine everything into one mammoth query and hence only require 19 files?


thanks,
ERTW.


 
Look at the PARAMETER query. You would replace the course info in your queries with the PARAMETER to designate the specific course. Re-use the same set-up for each course.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top