--Error code
DECLARE @dt VARCHAR(10)
SET @dt = '12012009'
SELECT CAST(@dt AS DATETIME)
--Working code
DECLARE @dt VARCHAR(10)
SET @dt = '20091201'
SELECT CAST(@dt AS DATETIME)
Tuesday, January 19, 2010
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment