Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNIQUE VALUE WITH MAX DATE

Status
Not open for further replies.

2009luca

Programmer
Jul 27, 2013
222
IT
I have in a atable:

FIELD1 FIELD2
AAAA 01/01/2016
AAAA 13/03/2016
BBBB 01/03/2016
...

I need with, a sql, to exctract a unique records in field1 based the max date in field2...

result for me:
AAAA 13/03/2016
BBBB 01/03/2016


note:
i use ADO and vb6
 
Select FIELD1, MAX(FIELD2) As FIELD2
From atable
Group By FIELD1

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top