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

Click here to load this message in the networking platform