Solved

Access Select query producing duplicate records

Posted on 2013-05-29
8
395 Views
Last Modified: 2013-10-15
running access 2k10, query which is producing multiple duplicate records in the result. Not on all records, just some. I've checked all related tables and there are no duplicates. I've added "Distinct" to the query but no change.

I've attached an rtf doc with the access query and the sql view. Any help greatly appreciated.
Document.rtf
0
Comment
Question by:jsgould
8 Comments
 
LVL 4

Assisted Solution

by:urthrilled
urthrilled earned 167 total points
ID: 39205213
Try linking the Job table to the Tasks table by Job_No, instead of from JobRS to Tasks.
0
 

Author Comment

by:jsgould
ID: 39205583
No difference, linking as . I believe it has something to do with Tasks. If I remove them from the query completely, I don't get the dups
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 167 total points
ID: 39206484
I've added "Distinct" to the query but no change.

Please indicate what you mean by "producing multiple duplicate records in the result", because DISTINCT will never give you duplicates.  It is impossible for this to happen.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:jsgould
ID: 39206501
if u look at the sql in the attachment above, I inserted distinct after SELECT in the vba sql statement.

For a few entries, not all, i will get 2 to 4 exact duplicate records for a given acronym.
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 39206518
jsgould, I am sorry to be a pain here, but that is simply not possible.  There has to be some difference in the records.
0
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 166 total points
ID: 39206855
it is my belief that some believe 'distinct' holds a magic quality and that it will intuitively know that the user wants only "one of something" and the other parts of a row "will just happen" (i.e. the magic occurs here).

select distinct -- is not magic
all, columns, will, be, evaluated, and, this, row, is, different, to, the, next, one, by, any, change
from real_world

the message is: "select distinct" works across everything in the row, the whole shooting match, the full enchilada, etc. Just the tiniest difference in any value will make a row "distinctive" from all other rows.

"multiple duplicate records" means you want something that select distinct cannot provide.

please provide your query, some results of it, and an explanation of what you consider is being duplicated. The solution almost certainly will not be "select distinct" by the way.

apologies in advance for the flippancy above - just trying to make a point through some humor
0
 

Accepted Solution

by:
jsgould earned 0 total points
ID: 39208974
viola! discovered that task file has duplicate records. Thanks for all ur assistance
0
 

Author Closing Comment

by:jsgould
ID: 39573141
I solved it by determining it to be a non-problem
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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 …

726 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