Adding a value to a 'datetime' column caused overflow.
- by sathya
Adding a value to a 'datetime' column caused overflow.
Came across this error today. So thought of posting the same.
Whenever you try to do a dateadd like this
dateadd(mm,12,datefield)
you might face this error if the value in your records in the datefield is not a valid date or
if u add some months or date to this value and the output of that will exceed the date range
In my case i was just thinking what would be the error here.
But unfortunately there was some data in the table which was there with the value
(Ex:date of joining column)
1-1-9999
So my sql statement has tried to add 12 months to this and it had caused this error.