Posted by laurenq uantrell on 10/10/12 11:33
Erland,
Why pass it as a string and then convert it to a date? In your example
you're passing the formatted date (Format(Date, "YYYYMMDD") ) as a
string to the varchar parameter, then converting it to a date in
@real_date? Why not just pass it to a datetime parameter in the first
place and have the error reporting of the client deal with formatting
problems rather than the vague-aries of SQL error reporting?
@indate varchar(10)
AS
Declare @real_date datetime
Select @real_date = Convert(datetime, @indate, 112)
[Back to original message]
|