The Wrecking Bawl

Destructuring query language, one keyword at a time.


News


If you've never passed a date as a parameter to a stored procedure while attempting to use the debugger in SQL Query Analyzer, you probably don't know that the date must be in a certain format (ain't nothin' but an ODBC thing) in order for things to work.  If the date is not in the format [YYYY-MM-DD] or something similar (my new motto: dashes not slashes, or hyphens not... nothing really rhymes with hyphens), then you will get an error like this: 

[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Comments

Gravatar # re: The More You Know (cue music): SQL Query Analyzer
Posted by Vicky on 3/23/2009 5:02 AM
Thank you!!!! I knew it had to do something with my formatting of that parameter. I tried all sorts of things including:

03/22/2009
3/22/2009
'3/22/2009'
22-3-2009

I even tried Cast('3/22/2009' as datetime) before I found your post. It's over two years old, but still helping people. :)
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: