Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using CONVERT() function
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01666022
Message ID:
01666023
Views:
39
>Hi,
>
>My stored procedure has the following code:
>
>SET @TargetDate = CONVERT(datetime, @TargetDate)
>
>Which converts a string @TargetDate to a datetime value.
>The above works when used with American customers
>
>But when using with a European customer where the string value of @TargetDate (before the conversion) is set by ToShortDateString(), the result is an error (The conversion of a varchar data type to a smalldatetime data type is out-of-range value).
>
>Is there a 3rd parameter I can use with the above CONVERT() function to get around the problem?
>
>TIA

And this works?
I doubt it, you can not redefine type of the variable from n/var/char to datetime.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform