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!

articles with the oldest date

Status
Not open for further replies.

michelleqw

Programmer
Jan 4, 2004
120
DE
Dear readers,

is there someone who can give a solution of our problem?

We have one table with two fields: an articlenumber and a date field. We try to get the articlenumbers with the oldest date.

articlenumber datefld
a 2004-01-20
a 2004-04-12
a 2005-06-08
b 2003-04-20
b 2004-12-08
b 2003-09-12

The result of the query must be:

articlenumber datefld
a 2005-06-08
b 2004-12-08

Thanks for reading and hopefully a solution.

Nice regards,

Michelle.
 
A starting point:
SELECT articlenumber, Max(datefld) NewestDate, Min(datefld) OldestDate
FROM yourTable
GROUP BY articlenumber

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top