OI_USETY_EFF_VW

(SQL View)
Index Back

VAT Use Type

VAT Use Type with Effective Start Date & End Date

SELECT SETID , VAT_USE_ID , EFFDT AS EFF_ST_DT , CASE WHEN LEAD(CONCAT(SETID ,VAT_USE_ID) ,1 ,NULL) OVER ( ORDER BY SETID ,VAT_USE_ID ,EFFDT) <> CONCAT (SETID ,VAT_USE_ID) THEN TO_DATE('9999-12-31' , 'YYYY-MM-DD') ELSE CASE WHEN LEAD(EFFDT ,1 ,NULL) OVER ( ORDER BY SETID ,VAT_USE_ID ,EFFDT) = EFFDT THEN EFFDT ELSE LEAD(EFFDT-1 ,1 ,TO_DATE('9999-12-31' , 'YYYY-MM-DD')) OVER ( ORDER BY SETID ,VAT_USE_ID ,EFFDT) END END AS EFF_END_DT FROM PS_VAT_USE_TBL ORDER BY 1 , 2 , 3

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 SETID Character(5) VARCHAR2(5) NOT NULL SetID
2 VAT_USE_ID Character(6) VARCHAR2(6) NOT NULL VAT Use Type
3 EFF_ST_DT Date(10) DATE Effective Start Date
4 EFF_END_DT Date(10) DATE Effective End Date