SELECT * from orderTable
WHERE orderId =
(SELECT max(orderId)
FROM orderTable
WHERE usercode = 'usercode')
-Original Message-
From: Jon Hall [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 27, 2001 3:42 AM
To: CF-Talk
Subject: Get newest record?
I have a query that returns placed
max(orderid)
"Jon Hall" [EMAIL PROTECTED] wrote:
I have a query that returns placed orders by a customer. How would I pull
olny the newest order by a particular customer?
I have a datestamp field and an autonumber id field if that helps...
I know I could do
SELECT TOP 1 *
FROM orderTable
WHERE
I have a query that returns placed orders by a customer. How would I pull
olny the newest order by a particular customer?
I have a datestamp field and an autonumber id field if that helps...
I know I could do
SELECT TOP 1 *
FROM orderTable
WHERE usercode = 'usercode'
ORDER BY orderdatetime DESC
3 matches
Mail list logo