Fixes #81: Pivot report type is not formatting the SQL correctly