Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid date
Message
De
17/07/2014 04:41:29
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01603774
Message ID:
01603883
Vues:
60
>>Supplementary Question
>>
>>Anyway to stop a query failing if there is an invalid date encountered (replace it with NULL maybe )
>
>In SQL 2012 and up just use TRY_CAST instead of CAST().
>
>Otherwise use
>
>case when DateCol < '17530101' then NULL else cast(dateCol as DATETIME) end
Thanks Naomi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform