Duplicating queries do not produce the same results

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

Guest

1. I duplicate a query with joins (the kind where both fields must match
2. When running the queries, different results are produced
3. It seems the duplicated programs exclude records that should be included
and are included in the original query.
4. Can someone please explain this to me?

Thanks
 
If two queries contain the same SQL statement and operate on the same
dataset, you can count on their returning the same resultss. But I'm not
sure I understand what you mean by (a) duplicate queries and (b)
duplicated programs. Can you explain more clearly, and give examples of
the differences?
 
Here's the scoop
1. I had a query with all built and working great
2. it processes against a table with some joins
3. I wanted the exact same query to run against another table
4. I copied the query, brought in the new table, pointed the data elements
to the new table, join the table to the other stuff, then deleted the
original table it replaced.
5. When running the new query, many qualifying records did not output
6. Creating the same query from scratch produced the right results.
7. I thought i'd same development time doing this and ended up spending
several hours trying to debug it....

Please advise & thanks

Paul
 
All I can suggest is that you should open the two queries (the one you
copied and modified, and the one you created from scratch) in SQL view
and compare the two SQL statements. The differences between them should
show you what went wrong in the copy-and-modify routine.

Probably the query designer got confused when you added one table and
deleted the other. It's much simpler to modify queries in this way in
SQL view: you just replace the original table name with the new one
wherever it appears. If the query's at all complex, I paste the SQL
statement into a text editor, use search-and-replace to change the table
name, and paste the result back into the SQL view of the query.
 
Thanks.. that's a great suggestion...i stay in query designer and rarely get
into the SQL view..
 
Back
Top