Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invalid date
Message
De
16/07/2014 05:45:07
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Invalid date
Versions des environnements
SQL Server:
SQL Server 2014
Application:
Web
Divers
Thread ID:
01603774
Message ID:
01603774
Vues:
50
HYi

I'm taking some data from adatabse with datetime2 fields

the SQL casts these as a datetime

CAST(D.UNAVAILABLE_FROM_DATE AS DATETIME) AS UNAVAILABLE_FROM_DATE

and I'm getting an error

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value

any ideas on the best way to find the offending date . (theres about 200000 records)

at the moment I'm selecting the date without the cast and ordering by the date but there's quite a few of these date casts so I wondered if there was a quicker way.

Thanks

Nick

Thanks

Nick
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform