This is a simplified version of what I'm doing, but I can't get anything to work. The statement gives me an error without the comma after 'ERR'. I want the column to be 'Month' and I tohught this would work but I'm having a ton of trouble. Thanks for your help!
select a.POL_PRI_RSK_ST_CD, a.MASTER_COMPANY_NBR, case when a.char046 is NULL then 'ERR' when a.char046 > '010' then '11+' else a.char046 end as Policy_Years, a.Last7Days, a.Last30Days, a.Last90Days from reporting a inner join Repository b on a.RECORD_ID = b.RECORD_ID where a.POL_OGN_EFF_DT >= '2008-11-01' group by a.POL_PRI_RSK_ST_CD, a.MASTER_COMPANY_NBR, case when a.char046 is NULL then 'ERR' when a.char046 > '010' then '11+' else a.char046 end as Policy_Years, a.Last7Days, a.Last30Days, a.Last90Days