Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re^3: DBI::ODBC Stored Procedure execution

by john_oshea (Priest)
on Jan 28, 2008 at 13:20 UTC ( #664677=note: print w/replies, xml ) Need Help??

in reply to Re^2: DBI::ODBC Stored Procedure execution
in thread DBI::ODBC Stored Procedure execution

As far as I'm aware, it's specified in the SQL standard - the following is lifted from Joe Celko's "SQL For Smarties" book (recommended, btw):

In SQL, character strings are printable characters enclosed in single quotation marks. ... Double quotations marks are reserved for column names that have embedded spaces or that are also SQL-reserved words.

Without the quotes, you're passing a number a bit larger than 20 million to the stored procedure (which is left unconverted, even though it looks like a date). With the quotes, SQL Server is clever enough to try to convert the string to a date, so it does what you mean. You can, if you want, explicitly control how the conversion gets done using CAST:

Hope that helps.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://664677]
[jedikaiti]: ahhhh
[jedikaiti]: Never heard it referred to that way
[jedikaiti]: Happy Birthday to him!
[Discipulus]: ah! how do you say in english? .. i was sure..
[Discipulus]: ah turned

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2018-01-18 20:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (214 votes). Check out past polls.