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

Query to find latest date in table

Status
Not open for further replies.

prodtest

Technical User
Aug 29, 2003
55
GB
I need to perform a simple query which returns the last record entered in a table, from this query I will run a report.
I have built a report based on the query, is there an expression I can use in the date field of my query which will return just the last entry ?
 
If the records are timestamped you may try something like this:
SELECT * FROM yourTable
WHERE yourDateTimeField = (SELECT Max(yourDateTimeField) FROM yourTable)

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