?
Solved

Access Select query producing duplicate records

Posted on 2013-05-29
8
Medium Priority
?
413 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
[X]
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
8 Comments
 
LVL 4

Assisted Solution

by:urthrilled
urthrilled earned 501 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 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 501 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 93

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 49

Assisted Solution

by:PortletPaul
PortletPaul earned 498 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

770 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