Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access Select query producing duplicate records

Posted on 2013-05-29
8
388 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

860 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