SQL (Access, yech) Query help

Discussion in 'OT Technology' started by skelm, Sep 14, 2006.

  1. skelm

    skelm New Member

    Joined:
    Jan 9, 2006
    Messages:
    868
    Likes Received:
    0
    Location:
    Australia
    Hi guys,

    I'm making a query but I'm wondering what I would add so that UnitNo won't be selected if a UnitNo already exists, it also needs to check that if there are two Unit no's the one that has the latest date field is used...
     
  2. Kewlb

    Kewlb New Member

    Joined:
    Nov 21, 2002
    Messages:
    1,510
    Likes Received:
    0
    You need to post your table structure so we can better help you. What you are asking sounds pretty easy, just need the table structure to ensure.
     
  3. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    GROUP BY UnitNo, Max(date) ? As he says, need the schema.
     
  4. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Check the query wizard for find duplicates - prolly get you pretty far.
     
  5. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,562
    Likes Received:
    649
    Location:
    Your mother.
    having MAX(UnitNo)
     

Share This Page