vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| The following toy query, in Query Analyzer SELECT RIGHT(DATENAME(YEAR, GETDATE()), 2) yy returns '03'. When I run the same query over ODBC (from, say, QTODBC), the result is '0'. Similarly, SELECT RIGHT(DATENAME(YEAR, GETDATE()), 4) yy returns '200' when run over ODBC. I've worked around it using a CAST/CONVERT, as follows SELECT RIGHT(CAST(DATENAME(YEAR, GETDATE()) AS VARCHAR), 2) yy but I'm concerned that I might be missing a trick and that this bug may be an effect of a more insidious bug that I should know about. Is this a known issue (or an effect of one)? Are there any work-arounds that don't involve altering the SQL (using, say, ODBC connection parameters)? (The bug is present in various versions of the ODBC driver when connecting to various versions of SQL Server, including SQL Server 7 and SQL Server 2000 SP3.) Thanks in advance. Grant Husbands. |
| Thread Tools | |
| Display Modes | |
|
|