I am no expert but i think that your host either down graded or upgraded SQL verision to your server and that perhaps causing this issue. (Coz i think the SQL query is correct)
So wait for an exper to reply but in the meanwhile ask your host if they have changed the SQL server version.