In Open Reports >> Admin Reports, currently it only allows queries starting with "SELECT". Please consider allowing the use of Common Table Express (CTE - i.e. the WITH clause), see https://modern-sql.com/feature/with