Fix sql error in report. closes #2545