I would start with checking the error messages. put the sql string into a variable and echo that out.
What happens when you paste it into phpMyAdmin?
Does it look sensible?
*Do you have a case sensitivity problem?
If necessary dummy up the tables and query in M'soft Access and see what's different.