Question : T-SQL query question about row_number()

I have this query that Ramalda helped with but this does not segment the row based on the employee and each of the options in the where statement
 "ev.empgcstf1 in ('Hep B Series 2', 'Hep B Series 2', 'Hep B Series 1', 'T.B. Test', 'CPR', 'First Aid', 'AED Essentials','Annual Physical') "
I need a query that shows each one that is due based on the date not one that excludes many of the tests based on the dates for all for all of them as a whole. They each need to be dealt with independently but I'm hoping not to have to create a query that is separate for each one. Thanks

select * from (
select
      e.empuid,
      ev.enddate,
      ev.startdate,
      ev.lstmoddate,
      e.lastname,
      e.firstname,
      ev.empgcstf1,
      row_number() over (partition by e.empuid order by ev.enddate desc) rn
from empcstfv ev
inner join employee e on ev.empuid = e.empuid
where      ev.empgcstf1 in ('Hep B Series 2', 'Hep B Series 2', 'Hep B Series 1', 'T.B. Test', 'CPR', 'First Aid', 'AED Essentials','Annual Physical')
      and e.termdate is null and DateDiff(day, ev.EndDate, GetDate())  <= 90
)  a
where rn = 1

Answer : T-SQL query question about row_number()

Instead of:
    var parentTxt = $(this).parent('span.folder').text();

use:
 var parentTxt = $('span.folder', $(this).closest("ul").parent() ).text();

which basically states:
look for span.folder WITHIN $(this).closest("ul").parent().

If you take a closer look at your markup, it should be clear that when you click on Search, $(this).closest("ul") refers to <ul id="test"> and its parent is the li that contains both, <ul id="test"> AND <span class="folder">.

So essentially this:
$(this).closest("ul").parent()

refers to the first <li> in <ul id="treemenu">. So, to summarize:

$('span.folder', $(this).closest("ul").parent() ).text();
says:
look for span.folder within the li in <ul id="treemenu">
Clear?
Random Solutions  
 
programming4us programming4us