SELECT
CONVERT(VARCHAR, DATEADD(YEAR, 150, CAST(dob AS DATETIME)), 107)
FROM
CUSTOMER
This code results in the following error:
Adding a value to a 'datetime' column caused an overflow
SELECT
CONVERT(VARCHAR, DATEADD(YEAR, 150, CAST(dob AS DATETIME)), 107)
FROM
CUSTOMER
This code results in the following error:
Adding a value to a 'datetime' column caused an overflow
Your dob
column contains one or more dates that are greater than Dec 31, 9849
- this is the latest date that you can add 150 years to and still remain under the maximum value a DATETIME may have, which is 23:59:59.997
on Dec 31, 9999