Question:
I need to get the DATE ONLY (= date WITHOUT time) with an ODBC escape sequence.
However
SELECT
{fn CONVERT(SomeTable.Col_With_DateTime_Value, SQL_DATE)}
FROM SomeTable
does return the column as datetime value (date WITH time).
Is there any ODBC function I can use to get the date value only ?
Note:
This is not a duplicate question.
I know one can use the non-ODBC convert function, like
CONVERT(char(8), getdate(), 112) AS v112_ISO
CONVERT(char(10), getdate(), 104) AS v104_XML
but I really need an ODBC function for compatibility reasons.
You could use this:
Works in the environments I have available to test on (SQL Server 2000-2012).
Update:
Here is another way that I believe could be faster than using convert.