Solved

Duplicate Rows Missing in Union Query

Posted on 2008-10-14
3
507 Views
Last Modified: 2012-05-05
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???
halp.gif
0
Comment
Question by:miqrogroove
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 22718540
Union removes duplicates.
Use
Union ALL
0
 
LVL 11

Author Comment

by:miqrogroove
ID: 22718548
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. :)
0
 
LVL 11

Author Closing Comment

by:miqrogroove
ID: 31506207
My tax returns are saved!  Thank you!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now