0

And please, before marking this as duplicate I have read this post many, many times the first thing that always pops up in google but I do not think it addresses my question.

In pass-through queries via ODBC to SQL Server 2008 R2...

This DOES works:

 (SELECT x, convert(date, y) FROM so_q1);

but this DOES NOT work:

 (SELECT x, (cast y as date) FROM so_q1);

Any idea why?

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425

1 Answers1

3
(SELECT x, (cast y as date) FROM so_q1);-- does not work because it is the incorrect syntax.

(SELECT x, cast( y as date) FROM so_q1); --works just fine.

thank you @AlexK

Pரதீப்
  • 88,697
  • 17
  • 124
  • 160