By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,610 Members | 1,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,610 IT Pros & Developers. It's quick & easy.

Selecting Unique ID w/ Max Date

P: 3
Hey guys,

I’m new to access and databases and I’m having a bit of trouble coming up with a query that will do what I need. I have a table in the form of:

GroupField1, GroupField2, Data, DateOfEntry

such that the user can enter “Data” in each permutation of GroupField1, and GroupField2, on any “DateOfEntry”.

I want a query that will return the “Data” associated with every permutation of GroupField1 and GroupField2 on the latest DateOfEntry (i.e. the max(DateOfEntry) ).

I know if I just wanted to pull out GroupField1, GroupField2, and DateOfEntry, I could just write a query in the form of

SELECT GroupField1, GroupField2, Max(DateOfEntry)
FROM Table
GROUP BY GroupField1, GroupField2

But obviously I can’t also group by “Data” so how would I get the “Data” value associated with the MaxDateOfEntry?

Thanks a lot!
May 30 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 12,441
Try a subquery instead.
May 30 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.