I have execute new query as below:
alter table tenancy_extend_old alter column createdate datetime
but it show messages error as below: Msg 242, Level 16, State 3, Line 1 The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated.
Please help me. thanks
SELECT createdate FROM dbo.tenancy_extend_old WHERE ISDATE(createdate) = 0;
– Aaron Bertranddatetime
(January 1, 1753, through December 31, 9999) or if you're actually storing dates from the year 201, consider usingdatetime2
(January 1,1 AD through December 31, 9999 AD) or use justdate
(January 1, 1 AD through December 31, 9999 AD) if you have a more recent version of SQL Server (2008+) and don't need time data. It's going to depend on whether'Dec 18 201'
actually refers to the year 201 or if someone clearly mistyped2001
or2010
or2011
. – Bacon Bits