I need some help to filter a record set using the greatest year:
My sql
select EMPLID,Action_DT from PROFILES.dbo.ps_job where Action in ('PRO','XPR') AND EMPLID in ('062497','105149')
ORDER by EMPLID des
I just place two EMPLID but could be thousands of them.
EXAMPLE
EMPLID date
105149 2005-03-28 00:00:00.000
105149 1997-02-28 00:00:00.000
105149 1998-12-23 00:00:00.000
105149 2003-04-11 00:00:00.000
105149 2000-04-04 00:00:00.000
062497 1992-05-01 00:00:00.000
062497 1998-03-04 00:00:00.000
I would like to obtain:
id date
105149 2005-03-28 00:00:00.000
062497 1998-03-04 00:00:00.000
If some one can help me I will appreciate it
Raul
My sql
select EMPLID,Action_DT from PROFILES.dbo.ps_job where Action in ('PRO','XPR') AND EMPLID in ('062497','105149')
ORDER by EMPLID des
I just place two EMPLID but could be thousands of them.
EXAMPLE
EMPLID date
105149 2005-03-28 00:00:00.000
105149 1997-02-28 00:00:00.000
105149 1998-12-23 00:00:00.000
105149 2003-04-11 00:00:00.000
105149 2000-04-04 00:00:00.000
062497 1992-05-01 00:00:00.000
062497 1998-03-04 00:00:00.000
I would like to obtain:
id date
105149 2005-03-28 00:00:00.000
062497 1998-03-04 00:00:00.000
If some one can help me I will appreciate it
Raul