I seem unable to work out the syntax to set a stored procedure paramter to a default date.
I have tried
But that errors with "Conversion failed when converting date and/or time from character string."
I then tried
But that won't compile.
I want to set a default if no date is passed to the SP as the current date in 'YYYY-MM-DD' format.
How would I do this?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I have tried
Code:
@EndDate char(10) = GETDATE
But that errors with "Conversion failed when converting date and/or time from character string."
I then tried
Code:
@EndDate char(10) = CONVERT(char(10),GETDATE(),126)
But that won't compile.
I want to set a default if no date is passed to the SP as the current date in 'YYYY-MM-DD' format.
How would I do this?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads