Fix sql error in report. closes #2545

Conflicts:
	report/not_queried_recently.php