Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2007

Tip: Looking for answers? Try searching our database.

Getting most recent detail record for each master and associated fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 08 Mar 2007 22:21 GMT
Hi all
   This is embarrassing because I know this has to be very simple but
I'm just not getting it so --

I have a single, detail table.  One field is (serialnoFK) a foreign
key to a different table. Another field (outdate) is an activity date/
time field.

I just need a query that will give me one record for each SerialNoFK.
This needs to be the last outdate for each SerialNoFK.

I tried to use the aggregate functions but I need the other two fields
(Location, and Name) for each selected record and I can't figure out
how to get those.

So for this recordset --
tblTrack
TrackNo    SerialNoFK    OUTDATE    LOCATION    NAME
55    WYW001    12/6/2006 3:59:42 PM    DESK    Person1
56    WYW001    3/7/2007 11:47:55 AM    DESK    Person2
62    WYW001    3/7/2007 11:51:17 AM    DESK    SHELF
51    WYW002    12/6/2006 3:58:30 PM    DESK    Person1
57    WYW002    3/7/2007 11:48:10 AM    DESK    Person2
63    WYW002    3/7/2007 11:51:19 AM    DESK    SHELF
66    WYW003    3/8/2007 11:08:53 AM    DESK    Person2
67    WYW003    3/8/2007 11:13:16 AM    DESK    Person3
69    WYW003    3/8/2007 11:14:10 AM    DESK    Person3
72    WYW003    3/8/2007 1:36:38 PM    DESK    Person3

I want a query that will return --

TrackNo    SerialNoFK    OUTDATE    LOCATION    NAME
62    WYW001    3/7/2007 11:51:17 AM    DESK    SHELF
63    WYW002    3/7/2007 11:51:19 AM    DESK    SHELF
72    WYW003    3/8/2007 1:36:38 PM    DESK    Person3

The most recent record for each serialNoFK
Van T. Dinh - 08 Mar 2007 23:18 GMT
See The Access Web article:

http://www.mvps.org/access/queries/qry0020.htm

HTH
Van T. Dinh
MVP Access

> Hi all
>    This is embarrassing because I know this has to be very simple but
[quoted text clipped - 33 lines]
>
> The most recent record for each serialNoFK
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.