Results 1 to 6 of 6
  1. #1
    ruf7109 is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    2

    Query to return only most recent unique values

    I read through some of the other unique value posts and none seem to fit my needs. I am a bit new to Access, I think I have a decent grasp, but there is a lot to learn.

    I have a set of devices that are assigned to a truck, on occastion they are moved from truck to truck, I need to be able to track where they are AND where they have been. Here is what I have:



    ID (autonumber)
    GPS ID (number, this is the specific ID to each device)
    Truck Number (this is the specific ID for each truck
    Installation Date (Date installed / moved)

    I have created a query to show the data I need, I have put them in order based on date.

    - I must keep each event stored on the table

    Goal:

    To show a list of the current location of each device, nothing more.

    Thank you for your help!

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I think readers would like to know more about this part
    they are moved from truck to truck
    How, when, why, by whom? I think this is key to tracking.

    For clarity, you are interested in the location(s) of the devices or the trucks or both?
    I asked because if you want to know which truck has which device, I don't see the need for GPS.
    I do recognize you have said GPSID, so it is device, but I'm a little confused with
    where they have been
    .

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Whoever is in charge of assigning a device to a truck would update a table that had

    tblGPSAssignment
    GPSAssignmentID (Autonumber)
    GPSID (Long)
    TruckID (Long)
    UserID (Long)
    AssignmentDate (Date)
    ...

  4. #4
    ruf7109 is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    2
    The devices are GPS devices. So I need to know which GPS device is on which truck at this time. So I want to limit my query results to only recent unique values.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    For one method, review http://allenbrowne.com/subquery-01.html#TopN

    Other methods would involve aggregate query or domain aggregate functions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    ruf7109,

    Did you see ItsMe's post -- the event where the devices change trucks is where you want to capture and record information. How many you may want to display is a separate issue.

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

Similar Threads

  1. Unique Values in Query
    By genedi in forum Access
    Replies: 2
    Last Post: 09-09-2015, 04:51 PM
  2. Counting unique values in a query
    By DHIGHTO in forum Queries
    Replies: 4
    Last Post: 01-21-2015, 08:19 AM
  3. Replies: 1
    Last Post: 12-08-2014, 06:16 PM
  4. Limiting Query Results to Unique Values
    By orangeman2003 in forum Queries
    Replies: 2
    Last Post: 12-25-2013, 01:08 PM
  5. Duplicate Query Reporting Unique Values...
    By Tomfernandez1 in forum Queries
    Replies: 5
    Last Post: 04-19-2011, 04:22 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