DATEDIFF produces an error if the result is out of range for integer values. For milliseconds, the maximum number is 24 days, 20 hours, 31 minutes and 23.647 seconds. For seconds, the maximum number is 68 years.
To work around this issue you can do something like following
instead of calculating the difference in seconds, you can calculate it in minutes, then multiply it by 60
convert(bigint,datediff(mi,’19000101′,’20100101′)) * 60
Thematic is a free, open-source, highly extensible, search-engine optimized WordPress Theme Framework featuring 13 widget-ready areas, grid-based layout samples, styling for popular plugins, and a whole community behind it. It’s perfect for beginner bloggers and WordPress development professionals.