dranreb dino
dranreb dino

Reputation: 260

Simple access query with group by and order by

I have a query like this on MS Access:

select id_number from students_log group by id_number order by log_date

but it gives me this error:

You tried to execute a query that does not include the specified expression "log_date"
 as part of aggregate function.

I am wondering why am I unable to run this simple query and what workaround should i do?

Upvotes: 0

Views: 1327

Answers (1)

Gustav
Gustav

Reputation: 55981

Try using the latest log_date:

select id_number 
from students_log 
group by id_number 
order by max(log_date)

Upvotes: 1

Related Questions