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

Access: Finding the Highest Record in a field Using a Query

Status
Not open for further replies.

klmorgan

Technical User
Aug 31, 2001
224
GB
Is it possible to find the highest dated record using a standard Query ie.


In a table of invoices find a record that finds the last record for a person

Name Invoice Date
= "Morgan" =Highest Date

I've looked through the operators and can't see one to fit.

Regards

Keith
 
By "Highest Date" I presume you mean newest.

Something like the following SQL will bring it up for every customer:

Code:
SELECT customername, max (invoice_date) As LatestInvoice
FROM yourtable
GROUP BY customername
ORDER BY customername

To bring up the latest for just one specified customer:
Code:
SELECT customername, max (invoice_date) As LatestInvoice
FROM yourtable
WHERE customername = [Enter Customer Name]
GROUP BY customername

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top