Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using CONVERT() function
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Using CONVERT() function
Divers
Thread ID:
01666022
Message ID:
01666022
Vues:
66
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform