• Ted's approach will help you figure out what part of the code has the problem and I was taught this same approach to troubleshooting query errors. It has been very helpful for me to tear the query apart and rebuild it piece by piece until the error happens.