datediff() returns an integer. The max value for an integer is 2,147,483,647. That work out to be about 24855 days
This is fine for most cases but if you have bad data, you will get overflow error.
I have written a function just to calculate the different of 2 dates in terms of seconds. It returns the seconds in a bigint.
It first find the different in terms of days and then multiply by 24 x 60 x 60 to convert to number of seconds. Then it subtract and add the time different for the start date and the end date to get the total different in seconds for the 2 dates.
Here is the function.