I am trying to create a query to only count application numbers that end between 0-6, and compare them to applications that end between 7-9. For example application nubmer 1126 would be in the 0-6 field, and 1118 would be in the 7-9 field. Any suggestions?
select FiscalMonth, FiscalWeek, COUNT(app_no) as '0-6', COUNT(app_no) as '7-9'
from USOnlineReporting.dbo.BO_IN_APP_QUEUE bia
inner join USOnlineReporting.dbo.Business_Dates_All bda on bda.Date = DATEADD(dd,0,datediff(dd,0,app_date))
inner join USOnlineReporting.dbo.CA_SS_STORE css on css.ST_CODE = bia.ST_CODE
where STATE_ID not in ('IN','IL','NV','OK')
and CUST_TYPE = 'new'
and FiscalMonth >= '201109'
and PROCESSING_STATUS <> 'denied'
and IS_NON_DIRECT_DEP = 'n'
group by FiscalMonth, FiscalWeek
order by fiscalweek