fix report sql