Query to return last date by & group (1 Viewer)

HeelNGville

Registered User.
Local time
Today, 11:26
Joined
Apr 13, 2004
Messages
71
Hello and thanks in advance for any suggestions.

My issue surrounds retrieving the last (based on most recent date) set of records based on the most recent date. I have query, containing 2 tables as the sources for the query results. Currently, the query yields:



Field A Field B Field C
123456 AAAA 1/8/13
123456 BBBBI 1/8/13
123456 CCCC 1/8/13
123456 DDDD 1/8/13
123456 EEEEEE 3/10/13
123456 FFFFFF 3/10/13
123456 GGGG 3/10/13
123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

The desired results would be to return all records with the last/max date, so yield:
123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

I have tried the max & last functions, yet no success. Again, any help would be appreciated!
 

pr2-eugin

Super Moderator
Local time
Today, 17:26
Joined
Nov 30, 2011
Messages
8,494
HeelNGville, you might need a SubQuery to get this.. Something along the lines of..
Code:
SELECT FieldA, FieldB, FieldC 
FROM yourTable
WHERE FieldC In (SELECT Max(FieldC) FROM yourTable);
 

Users who are viewing this thread

Top Bottom