Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using CONVERT() function
Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Using CONVERT() function
Miscellaneous
Thread ID:
01666022
Message ID:
01666022
Views:
65
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
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform