Solved

Duplicate Rows Missing in Union Query

Posted on 2008-10-14
3
503 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

19 Experts available now in Live!

Get 1:1 Help Now