replace tables or queries

  • Thread starter kakossouri_maria
  • Start date
K

kakossouri_maria

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???
 
R

Rick Brandt

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.
 
P

Pat Hartman

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.
 
K

Klatuu

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top