Results 1 to 2 of 2
  1. #1
    warlock is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2011
    Posts
    1

    Question Need help removing duplicates

    I am building a database to keep track of when equipment needs to be serviced and my format is something like this:



    ID - Date ID - Equipment - Date Serviced - Date Due
    1 ------- 1 ----- Item 1 --------- 1/1/09 --- 1/1/10
    1 ------- 2 ----- Item 1 --------- 1/1/10 --- 1/1/11
    2 ------- 3 ----- Item 2 --------- 2/2/09 --- 2/2/10
    2 ------- 4 ----- Item 2 --------- 2/2/10 --- 2/2/11

    I am trying to develope a query that would tell me all the items that are due, closest date first. My problem is I don't want I only want the newest due date for each item, so the previous years data would not show up. So my query for the items above would look like:

    ID - Date ID - Equipment - Date Serviced - Date Due
    1 ------- 2 ----- Item 1 --------- 1/1/10 --- 1/1/11
    2 ------- 4 ----- Item 2 --------- 2/2/10 --- 2/2/11

    I understand that it would be easier not to hold on to previous years dates but I need to keep them in there for our records. The only queries I've been able to build so far show me every single record. Does anyone have any idea on how I could do this?

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    so how about this:

    Code:
    select equip, max(duedate) 
    
    from table
    
    group by equip

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

Similar Threads

  1. Queries - Removing <Div Tags>
    By 9944pdx in forum Queries
    Replies: 5
    Last Post: 02-08-2011, 01:48 PM
  2. Removing parameters
    By katrinanyc926 in forum Reports
    Replies: 1
    Last Post: 08-04-2010, 04:24 PM
  3. Another removing weekends question
    By catguy in forum Access
    Replies: 6
    Last Post: 08-03-2010, 07:59 AM
  4. removing security from not my own database
    By zomas in forum Security
    Replies: 1
    Last Post: 08-01-2010, 10:43 PM
  5. Removing the delete prompt.
    By botts121 in forum Programming
    Replies: 4
    Last Post: 06-26-2009, 11:45 AM

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