Query to SQL Server 2008 with nested function call succeeds in SSMS but fails using ODBC I have a legacy database that is running SQL Server 2008 R2 Express Edition.