question

beegeeblueboy avatar image
beegeeblueboy asked

Returning max date record with a year for each employee

I have say ten employees (empi) Each has at least two records per year (Year) Each record has start date that differs (Startdate) Employees records exist over many years I want to use Max to select the record with the latest Startdate for each Year for each employee ie Each employee will only have one row for each year Thank you
functionsmax
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sjimmo avatar image sjimmo commented ·
Please show what you have tried already and the results.
0 Likes 0 ·

1 Answer

·
Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
If you include the YEAR in both the SELECT- and GROUP BY clauses you'll get the max per year.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.