Results 1 to 3 of 3
  1. #1
    Compufreak is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jul 2012
    Posts
    70

    Remove duplicate but keep the latest record

    Hi everyone

    im having some trouble with this query.

    Code:
    SELECT distinct  [CLUSTER]
    
     
    ----      ,[UNIT]
    
     
    ----      ,[NAME]
    
     
    ----      ,[ID NUMBER]
    
     
    ----      ,[DATE ENGAGED]
    
     
    ----      ,[SERVICE NO]
    
     
    ----      ,[DESIGNATION]
    
     
    ----      ,s.[SUBMISSION_DATE]
    
     
    ----  FROM [just_testing].[dbo].[NoDisclosures$] ls
    
     
    ----  INNER join [10.10.9.54].bpm.dbo.DOI_CASEDATA s on ls.[ID NUMBER]=s.[EMP_ID_NO]
    all i want is to remove the extra submission date.
    which basically means i want the latest submission date for each record.



    please assist

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You need a summation query (look for the sigma, looks like a capital E, on your toolbar) the default is GROUP BY in the totals line of your query. Change the SUBMISSION DATE field to MAX

  3. #3
    live2ride is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jun 2012
    Posts
    70
    select fileds
    from table1
    inner join (select id, max(submission_date) as submission_date from table1) as table2
    on table1.id = table2.id
    and table1.submission_date = table2.submission_date

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Limit query to only show the latest record
    By marcustofeles in forum Queries
    Replies: 12
    Last Post: 10-05-2011, 08:06 AM
  2. Get latest record
    By Sweet16 in forum Queries
    Replies: 9
    Last Post: 09-23-2011, 01:39 PM
  3. Remove Duplicate
    By rgparpaccessforums in forum Access
    Replies: 3
    Last Post: 04-24-2011, 07:24 PM
  4. Code to display latest record number field created?
    By rowardHoark in forum Programming
    Replies: 1
    Last Post: 01-31-2011, 08:03 AM
  5. Query latest record
    By asherbear in forum Queries
    Replies: 5
    Last Post: 08-02-2010, 03:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums