asullivan62
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thats exactly how I did it.
https://www.experts-exchange.com/Database/Miscellaneous/A_3203-DISTINCT-vs-GROUP-BY-and-why-does-it-not-work-for-my-query.html