Solved

I want to eliminate Duplicate Records  with minimum time

Posted on 2014-09-17
4
119 Views
Last Modified: 2014-09-17
I am including a sample database.  Trying to query to eliminate Duplicate Records with min time.  
I tried just the two fields---[ID]&[TakenTime] and works but add other fields it doesn’t.

Table:DupRecords
ID      MinOfCMMT_ID      TakenTime
6100174005      174005      9:12:00 AM
6100174005      174018      9:26:00 AM
6100174012      174012      9:18:00 AM
6100174012      174019      9:27:00 AM



Query1
SELECT DupRecords.ID, DupRecords.MinOfCMMT_ID, Max(DupRecords.TakenTime) AS MaxOfTakenTime
FROM DupRecords
GROUP BY DupRecords.ID, DupRecords.MinOfCMMT_ID;
I would appreciate any help!
DupRecords.mdb
0
Comment
Question by:ca1358
  • 2
4 Comments
 
LVL 13

Expert Comment

by:AielloJ
ID: 40328515
ca1358:

Can you provide an example of what you expect the results to be?

Best regards,

AielloJ
0
 

Author Comment

by:ca1358
ID: 40328524
6100174005      174018      9:26:00 AM
6100174012      174019      9:27:00 AM
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 40328631
try this query


SELECT T.*
FROM DupRecords AS T
INNER JOIN
(SELECT ID, Max(TakenTime) AS MaxOfTakenTime
FROM DupRecords
GROUP BY ID) As T1
ON T.ID=T1.ID and T.TakenTime=T1.MaxOfTakenTime
0
 

Author Closing Comment

by:ca1358
ID: 40328650
Awesome, Thank you!!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup 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.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

776 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