I recently came across this error "Difference of two datetime values caused an overflow at runtime" when I open the performance_dashboard_main_report.

Thanks to Keith Elmore for providing the fix and allowing me to post this here.

This is a caused by one of the queries in the report that attempts to do a datediff for a session that has been connected to the server for longer than ~20 days.  This can be fixed by editing the MS_PerfDashboard.usp_Main_GetSessionInfo procedure in setup.sql script as follows:

ORIGINAL:

sum(convert(bigint, datediff(ms, login_time, getdate()))) - sum(convert(bigint, s.total_elapsed_time)) as idle_connection_time,

 

CHANGE TO:

sum(convert(bigint, CAST ( DATEDIFF ( minute, login_time, getdate()) AS BIGINT)*60000 + DATEDIFF ( millisecond, DATEADD ( minute, DATEDIFF ( minute, login_time, getdate() ), login_time ),getdate() ))) - sum(convert(bigint, s.total_elapsed_time)) as idle_connection_time,