• Strange.

    Last week my queries weren't working but this week they are. As far as I can tell there have been no changes in the environments.

    What would cause the error temporarily? I have two network SQL Server servers. One is the development environment and the other is production. Both work now.

    The variable did not make a difference. I can write the code either way (with or without variables) and it works now.