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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return latest date

Status
Not open for further replies.

ajduk1

IS-IT--Management
Dec 3, 2005
95
GB
Hi
I have a table "Stock delivery" that has the fields storesrefno, productname, productdescription, openingstock, qtyrecd, orderdate.
It may be that a storesrefno may have 2/3 orderdates against it,others may have none.How can I return all storesrefno's,(including the ones with no order date) but only the latest instance of an orderdate on the no's that do have a order date.
Thanks in advance
AJD
 
select storesrefno, max (orderdate) as LatestOrderDate
from [Stock Delivery]
group by storesrefno

John
 
Thanks
worked a treat
again thanks for your time
AJD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top