in reply to Re: Invalid character value for cast specification
in thread Invalid character value for cast specification

Huge thanks- you did in fact "save future searchers some trouble", big time!

I was getting this error too, and I didn't realize it was because I hadn't included the hyphens in the date. I'm so used to doing '20130325' in SQL Server, and it does accept that form in other contexts.

But for parameterized queries, apparently one needs the hyphens like "2013-03-25', because once I read your comment and put the hyphens in, problem solved.

(Yes I love replying to a post 7 years after it was written, just to say thanks to a guy who will probably never read this)

  • Comment on Re^2: Invalid character value for cast specification