unique/Distinct Result In a Time Series

ardy

Registered User.
Local time
Today, 15:14
Joined
Sep 24, 2012
Messages
98
Hello All:
I have been struggling with understanding Queries related to Time Series. I find it difficult to get the right answer or understanding how to ask the right question Access style……

Table below is a sample data/table example for my question. The intent is to build a query that will return the latest date for each unique/Distinct name. I have Time Series Table that I haven’t been able to do this, it doesn’t return with Distinct Name………Can somebody shed some light on this. I Also have included a sample database……any help is appreciated……

TABLE
Name Date_1 Distance
------- --------- -----------
A 1/1/2014 10
B 1/3/2014 5
C 2/1/2014 10
A 1/3/2014 16
A 2/5/2014 3
B 5/1/2014 5
C 6/2/2014 6
C 7/1/2014 7

ANSWER SHOULD BE.
Name Date_1 Distance
------- --------- -----------
A 2/5/2014 3
B 5/1/2014 5
C 7/1/2014 7


Any Help Is really appreciated…….
 

Attachments

You will need a subquery to determine the last Date_1 for every person. Here's that sub-query:

Code:
SELECT Name_, MAX(Date_) AS LastDate
FROM Table_1
GROUP BY Name_;

Then use that query and Table_1 in a new query. Link them by Name_ fields and link Date_ to LastDate, then bring in all the data you want from Table_1
 
Thank you plog, That's the ticket........So easy... I see the approach........

Thank You, Thank You:)
 

Users who are viewing this thread

Back
Top Bottom