Fixed sql for use with school server