query help

G

Guest

I need to change my query so that it returns the record with the latest time
stamp. The table I am querying has multiple records for each order #. The
orders get appended with a code and a time stamp for each change in the order
process.
Any ideas? Here's my query

select ordernum, datestamp, ordercode
from orders
where ordernum = [Forms]![form1]![order.txt]
ORDER BY datestamp
 
S

Steve Schapel

Brian,

Try it like this...

SELECT TOP 1 ordernum, datestamp, ordercode
FROM orders
WHERE ordernum = [Forms]![form1]![order.txt]
ORDER BY datestamp DESC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top