SQL select statement

04-13-2004, 11:24 AM
I have an Access table with the following fields:
fldID(autonumber),fldLotNo, fldLength, fldDiameter, fldFrom, fldTo

This table has multiple records with the same fldLotNo value. The table is tracking the movements of the fldLotNo's from one warehouse to another. I'm trying to create a query that will select distinct fldLotNo records based on it's highest fldID value, thus giving me each fldLotNo's current warehouse location.



Jeff Sizemore

04-13-2004, 11:41 AM
I believe you want something like this:

"SELECT DISTINCT field1, MAX(field3) AS max_ID FROM myTable GROUP BY field1"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum