HWB_AVGHLD_VW

(SQL View)
Index Back

Avg days on hold last 30


SELECT H.BUSINESS_UNIT , H.HOLD_CD , %Round(AVG(%DecDiv(%DateTimeDiff(H.ACTIVE_HOLD_DTTM, H.LASTUPDDTTM),1440)),2) FROM %Table(ORD_HOLD_AUDIT) H , %Table(ORD_HEADER) O WHERE H.BUSINESS_UNIT = O.BUSINESS_UNIT AND H.ORDER_NO = O.ORDER_NO AND O.ORDER_TYPE_CD = 'SO' AND H.SHIP_FROM_BU = ' ' AND H.HOLD_LEVEL <> 'W' AND %DatePart(H.LASTUPDDTTM) >= %DateAdd(%CurrentDateIn, -30) AND H.HOLD_ACTION IN ('30', '40') GROUP BY H.BUSINESS_UNIT , H.HOLD_CD

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
2 HOLD_CD Character(6) VARCHAR2(6) NOT NULL Hold Code
3 DAYS_ON_HOLD Number(13,2) DECIMAL(12,2) NOT NULL Days on Hold