How do I run a query only asking for a max date of attendance?
I have to assume some things here because I'm not sure what your table looks like or what your columns are, but let's assume you have a table called StudentHistory. 

Let's say StudentHistory contains the columns StudentID, StudentName, SchoolName, LeaveDate.

Each student may have multiple entries depending on how many schools they have frequented. These entries can be ordered by the LeaveDate column to get a chronological history of attended schools.

What you want as an output can be articulated as: 


  For each student, return the StudentID, StudentName, SchoolName for
  the last School attended based on the latest LeaveDate.


You can achieve this using the RANK function:

WITH StudentData AS (
    SELECT StudentID, 
        StudentName, 
        SchoolName, 
        RANK() OVER(PARTITION BY StudentID ORDER BY LeaveDate DESC) AS TheRank
)
SELECT * 
FROM StudentData 
WHERE TheRank = 1 ;