Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I want to eliminate Duplicate Records  with minimum time

Posted on 2014-09-17
4
Medium Priority
?
138 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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 …
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 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