Johnfun10
Johnfun10

Reputation: 118

MS-Access Earliest Time Issue

SELECT ID, AppID, Description, Min([Transaction Date]) AS TransactionDate
FROM AppProsHist
WHERE [Description]='Non-Final Rejection'
GROUP BY ID, AppID, Description
ORDER BY Min([Transaction Date]) DESC

so lets say the AppID is "98" and the ID's are 12,14,16, (different numbers) and there are three dates which are described as "Non-final Rejection". The query is returning each date, in seemingly no order. I want just the earliest date for the AppID of "98".

Is this possible? I was under the impression the Min() would do this, however, it has not.

Upvotes: 2

Views: 53

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123829

You have included ID in the GROUP BY clause so you are getting the Min([Transaction Date]) for each ID. If you want the overall Min([Transaction Date]) for the AppID you need to remove ID from the GROUP BY clause.

Upvotes: 1

Related Questions