• I couldn't find anything on the Microsoft site about this bug, but I did find a discussion of it at http://www.dbforums.com/showthread.php?threadid=656046&goto=nextoldest.  According to the messages there, the bug is somehow related to the length of the SQL query string, but there is a workaround by including a CONVERT or CAST in the query, as is shown in SQL Statement B.

    (It looks like the missing open quote in SQL Statement B was an oversight.)