Link to home
Start Free TrialLog in
Avatar of asullivan62
asullivan62Flag for United States of America

asked on

t-sql max date function

I need to create a query that will return a employeeID, MAx(date) and jobchangereason
I need to allow all max dates where = 100
but no max dates on all other values in the same column

create table variable
insert into table variable
select  eeid, max(date). jobchange reason from mytable m
join  another table n
on n. eeid = m. eeid
where jobchangereason = 100
ASKER CERTIFIED SOLUTION
Avatar of Barry Cunney
Barry Cunney
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of asullivan62

ASKER

thats exactly how I did it.