I'm needing help writing a query that will convert a DATETIME value into a SMALLDATETIME value and drop any DATETIME values that would cause a SMALLDATETIME overflow error (use NULL instead).
Something like this maybe?
UPDATE TABLE
SET THISDATE = CASE WHEN THISDATE) >= 1/1/1900 OR DATEPART(yyyy, THISDATE) <= 6/1/2079 THEN THISDATE ELSE NULL END
Something like this maybe?
UPDATE TABLE
SET THISDATE = CASE WHEN THISDATE) >= 1/1/1900 OR DATEPART(yyyy, THISDATE) <= 6/1/2079 THEN THISDATE ELSE NULL END