Hello All!
The select statement creates the following:
How do the select to display:
Here is my SELECT:
thanks
cristi
The select statement creates the following:
Code:
KEY EMPL EARN WORK_PERIOD APPFUND
99999999 0010231 3025.83 200503 GW HDCONP
99999999 0010231 200506 GW HDCONP
99999999 0010231 433.5 200503 HW NHHW
99999999 0010231 200506 HW NHHW
How do the select to display:
Code:
KEY EMPLO EARN HW WORK_PERIOD FUND
9999 0010231 3025.83 433.5 200503 HDCONP
Here is my SELECT:
Code:
SELECT
MEMBER_WORK_PERIOD.MEMBER_KEY
, MEMBER_WORK_PERIOD.EMPLOYER_NO
, SUM ( CASE WHEN MEMBER_WORK_PERIOD.WORK_PERIOD IN ( '200501','200502','200503') THEN
MEMBER_WORK_PERIOD_FUND.QUANTITY END) AS EARN
--, SUM ( CASE WHEN MEMBER_WORK_PERIOD.WORK_PERIOD IN ( '200504','200505','200506') THEN MEMBER_WORK_PERIOD_FUND.QUANTITY END ) AS Q2_QTY_2005
--, SUM ( CASE WHEN MEMBER_WORK_PERIOD.WORK_PERIOD IN ( '200507','200508','200509') THEN MEMBER_WORK_PERIOD_FUND.QUANTITY END ) AS Q3_QTY_2005
--, SUM ( CASE WHEN MEMBER_WORK_PERIOD.WORK_PERIOD IN ( '200510','200511','200512') THEN MEMBER_WORK_PERIOD_FUND.QUANTITY END ) AS Q4_QTY_2005
, MEMBER_WORK_PERIOD.WORK_PERIOD
, MEMBER_WORK_PERIOD_FUND.APP
--, MEMBER_WORK_PERIOD_FUND.FUND
FROM
MEMBER_WORK_PERIOD_FUND, MEMBER_WORK_PERIOD
WHERE
MEMBER_WORK_PERIOD_FUND.MVPOS=MEMBER_WORK_PERIOD.MVPOS
AND MEMBER_WORK_PERIOD.MEMBER_KEY=MEMBER_WORK_PERIOD_FUND.MEMBER_KEY
AND MEMBER_WORK_PERIOD_FUND.FUND IN ( 'HDCONP','NHHW') AND MEMBER_WORK_PERIOD_FUND.APP IN ('GW','HW')
--AND MEMBER_WORK_PERIOD_FUND.MVPOS= MEMBER_WORK_PERIOD_FUND.SVPOS
AND LEFT(MEMBER_WORK_PERIOD.WORK_PERIOD,4)='2005'
AND MEMBER_WORK_PERIOD.MEMBER_KEY='045094654'
GROUP BY
MEMBER_WORK_PERIOD.EMPLOYER_NO
,MEMBER_WORK_PERIOD.MEMBER_KEY
,MEMBER_WORK_PERIOD_FUND.APP
,MEMBER_WORK_PERIOD_FUND.FUND
,MEMBER_WORK_PERIOD.WORK_PERIOD
thanks
cristi