My company owner asked which query runs longest and I found no ready script, so I wrote one: the Longest Running Query with its average and maximum time.
Rolling Date Ranges Forward Without Hard-Coded Years
Replace hard-coded years with indexed date ranges for current periods, full months, year-to-date comparisons, and any requested year.


