replace tables or queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

One of my queries(M.Access 2002), contains another query(name X). But,
i would like replace it with another query(name Y), which its structrure is
the same as X query. Also, the two queries have both the same fields with the
same structrure. The only difference between two queries is the names (X and
Y), and their Field names.
How can i replace a query with another query with an easy and fast
way, avoiding writing again their relationships, field names(design view) and
criteria???
 
kakossouri_maria said:
One of my queries(M.Access 2002), contains another query(name
X). But, i would like replace it with another query(name Y), which
its structrure is the same as X query. Also, the two queries have
both the same fields with the same structrure. The only difference
between two queries is the names (X and Y), and their Field names.
How can i replace a query with another query with an easy and
fast way, avoiding writing again their relationships, field
names(design view) and criteria???

Copy the SQL into a text editor that supports Find/Replace and use that to
replace all instances of X with Y and then paste the result back into the
SQL of your query.
 
Open the query in QBE view and add an alias.
Switch to SQL view.
Change the single instance of the table/query name in the FROM clause.

This shortcut won't work for any expressions. You will need to change them
manually.
 
One more way!
Open the query in QBE mode
Do Show Tables, and add Query Y
On the Table row, use the drop down to select Query Y as the table
Remove Query X
Oh, Yes, save it :)
 
Back
Top