selecting based on a text field and most recent date

eellenoff

Registered User.
Local time
Today, 02:12
Joined
Jul 17, 2007
Messages
17
Hello, I'm working with SQL and databases in general for the first time, and was wondering: how would I select just the most recent entry for each device? my data looks [roughly] like this:

device1 data_1a 15.2.2000
device1 data_1b 15.2.2001
device1 data_1c 15.2.2002
device2 data_2a 15.2.2000
device3 data_3a 15.2.2001
device3 data_3b 15.2.2002

So what I'm looking for is:

device1 data_1c 15.2.2002
device2 data_2a 15.2.2000
device3 data_3b 15.2.2002

Thanks for any help you can offer!
-Eric
 
Use an aggregate query (the sigma in the QBE) and set the device field to Group By and the date field (hopefully not named "Date" as that's a keyword) to Max.
 
Thanks a bunch!

that was just what I needed!
 

Users who are viewing this thread

Back
Top Bottom