Hello,
I have quite a bit of experience is dealing with PHP and SQL so I am confident I can write this query for you. Please send me a message so we can talk further. If you can give me the formula from the report card file, I can start right now.
Thank you,
Caleb