Query to select Max number

woknick

Registered User.
Local time
Today, 00:35
Joined
Sep 25, 2004
Messages
85
I have a table:

BarcodeList
Barcode Number 'string
Status 'String
Barcode ID 'autonumber

Im trying to write a query that will select The barcode number that has the greatest Barcode ID out of the tabel. Here is what I have so far

SELECT [BarcodeList].[Barcode Number]
FROM BarcodeList
GROUP BY [BarcodeList].[Barcode Number]
HAVING Max([Barcode ID]);

This returns a list of Bacode numbers but not one. I should get an output of that displays only one barcode with the highest Barcode ID

Thanks in advance
 
This will return the record with the highest Barcode ID:-

SELECT [Barcode Number], Status, [Barcode ID]
FROM BarcodeList
WHERE [Barcode ID]=(SELECT Max([Barcode ID]) FROM BarcodeList);
 

Users who are viewing this thread

Back
Top Bottom