Query Sort

S

State Troopers

Hi there.
In a query that I am running I need the first line of the results.
For example:
I have a table of products. Each product is given an id (2006-001 ..for
example) and a date added entry(when the product is added, the date is
entered and a new id(increments of 1..so 2006-002, 2006-003 ..and so on)
I need to be able to query the last added id. All I want is the last added
ID, and not a list of all the id's in descending order.

Is this possible?

Thanks.
_State
 
K

Klatuu

If you want to use it in a query, sort the query in descending order and use
the TOP 1 predicate.

Or, you can use the DMax in VBA

=DMax("[productid]", "ProductTable")
 

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