sougata666
Registered User.
- Local time
- Today, 11:05
- Joined
- May 1, 2016
- Messages
- 36
I have a list of employees with their category promotion dates (A category is better than B and so on. NA implies that the person is not yet categorised)
ID Category Date
-- ---------- -----
1 D 1/3/12
2 C 1/2/86
1 C 2/4/13
2 NA 1/3/81
3 NA 1/5/76
2 B 1/7/91
SELECT table.ID, Max(table.Date)
FROM table
WHERE (((table.Category)<>"NA"))
GROUP BY table.ID;
With the above code, I have managed to get only employee IDs who do not have NA in their category along with their last category upgradation date, like this:
ID Date
-- -----
1 2/4/13
2 1/7/91
But, as I am using the WHERE clause, I am being stopped from displaying the Category field. I want the Category field to be displayed as well, like so:
ID Category Date
-- --------- -----
1 C 2/4/13
2 B 1/7/91
How do I make this happen in Access 2013?
ID Category Date
-- ---------- -----
1 D 1/3/12
2 C 1/2/86
1 C 2/4/13
2 NA 1/3/81
3 NA 1/5/76
2 B 1/7/91
SELECT table.ID, Max(table.Date)
FROM table
WHERE (((table.Category)<>"NA"))
GROUP BY table.ID;
With the above code, I have managed to get only employee IDs who do not have NA in their category along with their last category upgradation date, like this:
ID Date
-- -----
1 2/4/13
2 1/7/91
But, as I am using the WHERE clause, I am being stopped from displaying the Category field. I want the Category field to be displayed as well, like so:
ID Category Date
-- --------- -----
1 C 2/4/13
2 B 1/7/91
How do I make this happen in Access 2013?