• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 536
  • Last Modified:

Duplicate Rows Missing in Union Query

Urgent assistance needed from fellow Access/Jet gurus to help me repair a glitch in accounting software.

I have a report that is based on a union query.  The union query joins two simple select queries.

Although the output of the underlying queries appears to be correct, when I view the raw output of the union query it has actually removed duplicate rows from the underlying queries.  This is critical because it is reporting transactions for which the dates and amounts may be identical for unique transactions.

Because the report is working in all other aspects, I prefer a solution that does not change the query output beyond restoring the duplicate rows.  Perhaps there is a DISTINCT keyword or equivalent that I need to mess around with?

Here is the raw union query:

TABLE [Report Cash Account Month]
UNION TABLE [Report Cash Previous Balance]
ORDER BY CashTransactionDate;

Should this cause rows to disappear???
  • 2
1 Solution
Union removes duplicates.
Union ALL
miqrogrooveAuthor Commented:
peter57r, thanks for the quick reply.  I believe you are correct.  I flipped open mysql.com and in their language it does default to DISTINCT.  I will accept after some testing. :)
miqrogrooveAuthor Commented:
My tax returns are saved!  Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now