I am not sure why an erorr message is occurring in my query. What am I doing wrong?
SELECT SUM(MEM_COUNT) MBR_MNTH,
P1_MBRMTH
FROM
(
SELECT
COUNT (MB.MB_JOIN_KEY) MEM_COUNT,
CASE WHEN MB.EFF_BEG_DT >= '2009/01/01' AND MB.EFF_END_DT <= '2009/01/31' THEN 'YES' ELSE 'NO' END AS P1_MBRMTH
FROM MB_TABLE MB
WHERE (MB.EFF_BEG_DT >= '2009/01/01' AND MB.EFF_END_DT <= '2009/01/31') OR
(MB.EFF_BEG_DT >= '2009/03/01' AND MB.EFF_END_DT <= '2009/04/30')
)MMM_MB
GROUP BY MEM_COUNT, P1_MBRMTH
;
Forums: