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

Reuse a query for multiple tables? 1

Status
Not open for further replies.

Keph

Technical User
Oct 15, 2002
16
0
0
CA
Hi, I'm wondering if it's possible to write a single query and use it to query multiple similarly structured tables. The tables have a few columns in common but are different enough otherwise to be in separate tables. I have managed to pass a paramater to a query, but I can only get the paramater to control what values from the given table are taken. Can I pass a parameter to tell it what table to look in? Any advice would be appreciated!
 
the only way I know to "do this" is to write the SQL to the qdf.sql property of the query. This is not really using the "SAME" query, except in the narrow sense of having only one "named" query (object) used for the several purposes. But, if this is the chosen path, you can just use an un-named query and accomplish the same thing.

You definitly cannot substitute the source table name as a 'parameter' to the query.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Thanks, I think that might be just what I'm looking for!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top