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
  • 732,580
  • 175
  • 1,330
  • 1,459

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ரதீப்
  • 91,748
  • 19
  • 131
  • 172