SELECT FCID.PERSON_ID_MANAGER , F.TIMEFRAME_PERIOD , INST.PT_CDB_DEF_CUR_CD , %Round(sum(%DecMult(CUR.INST_MULT , F.FROM_REVENUE)),0) FROM PS_RSF_FCAST_DTL F , PS_RSF_FCAST_USER U , PS_RSF_SUSER S , PS_RSFD_MGR_FCID_V FCID , PS_RSF_ACC_MGR_VW MGR , PS_RBD_CURRT CUR , PSCDBINSTALL INST WHERE F.FORECAST_CATEGORY = 'R' AND F.PERSON_ID = S.PERSON_ID AND F.TIMEFRAME_PERIOD = FCID.TIMEFRAME_PERIOD AND F.FORECAST_ID = FCID.FORECAST_ID AND F.FORECAST_ID = U.FORECAST_ID AND F.FORECAST_CATEGORY = U.FORECAST_CATEGORY AND F.PERSON_ID = U.PERSON_ID AND F.TIMEFRAME_PERIOD = U.TIMEFRAME_PERIOD AND U.FORECAST_SUBMITTED = 'Y' AND FCID.PERSON_ID_MANAGER = MGR.PERSON_ID_MANAGER AND F.PERSON_ID = MGR.PERSON_ID AND ((F.FROM_CUR = CUR.CURRENCY_CD AND F.FROM_CUR <> ' ' ) OR (F.FROM_CUR = ' ' AND S.CURRENCY_CD = CUR.CURRENCY_CD)) GROUP BY FCID.PERSON_ID_MANAGER , F.TIMEFRAME_PERIOD , INST.PT_CDB_DEF_CUR_CD
|