Added max date to last attendance inquiry.