Solved

I want to eliminate Duplicate Records  with minimum time

Posted on 2014-09-17
4
121 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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 …

685 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