You should be able to use that directly as a COMMAND when you assign the datasource.
Instead of selecting a table choose ADD COMMAND
If that doesn't work you can use groups
Group on the student then the examid
Sort by the date descending
You can display the information in the exam group header
Supress the details and group footer
mlmcc