RE_NO_PRVSLSRPT

(SQL View)
Index Back

Sales Report Search View

Sales Report Search View - SQL View: Used to display the search results of sales reports based on the various criteria entered and where the last reported date does not exist

SELECT A.BUSINESS_UNIT , B.END_DT , B.FISCAL_YEAR , B.ACCOUNTING_PERIOD , B.BEGIN_DT , C.NAME1 , A.LS_NBR , A.LS_KEY , A.LEASE_NAME , A.LEASE_STATUS ,%DateNull , '1' FROM PS_RE_LS A , PS_CAL_DETP_TBL B , PS_CUSTOMER C WHERE (B.BEGIN_DT >= A.LEASE_START_DT AND B.END_DT <= A.LEASE_END_DT) AND B.END_DT <= %CurrentDateIn AND NOT EXISTS ( SELECT 'X' FROM PS_RE_SLSRPT H1 WHERE H1.LS_KEY = A.LS_KEY AND H1.FISCAL_YEAR * 1000 + H1.ACCOUNTING_PERIOD < B.FISCAL_YEAR * 1000 + B.ACCOUNTING_PERIOD) AND B.CALENDAR_ID = A.CALENDAR_ID AND B.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC D WHERE D.RECNAME = 'CAL_DETP_TBL' AND D.SETCNTRLVALUE = A.BUSINESS_UNIT ) AND C.CUST_ID = A.PRENT_PRNCPL_ID AND C.SETID = ( SELECT SETID FROM PS_SET_CNTRL_REC E WHERE E.RECNAME = 'CUSTOMER' AND E.SETCNTRLVALUE = A.BUSINESS_UNIT) AND NOT EXISTS ( SELECT 'X' FROM PS_RE_SLSRPT F WHERE F.FISCAL_YEAR = B.FISCAL_YEAR AND F.ACCOUNTING_PERIOD = B.ACCOUNTING_PERIOD AND F.LS_KEY = A.LS_KEY)

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit
2 TO_DATE Date(10) DATE To Date
3 FISCAL_YEAR Number(4,0) SMALLINT NOT NULL Fiscal Year
4 ACCOUNTING_PERIOD Number(3,0) SMALLINT NOT NULL Identifies a time period to which you post transactions. Typically, an accounting period represents a month, but it can also represent a week, a day, or any user-defined interval. An accounting period has a beginning date and an ending date, and is defined in the calendar table.
5 FROM_DATE Date(10) DATE From Date
6 NAME1 Character(40) VARCHAR2(40) NOT NULL Name 1
7 LS_NBR Character(10) VARCHAR2(10) NOT NULL Lease Number, User Enterable or Generated Sequence Number
8 LS_KEY Number(15,0) DECIMAL(15) NOT NULL Lease Key, Unique Key
9 LEASE_NAME Character(60) VARCHAR2(60) NOT NULL Lease Name
10 LEASE_STATUS Character(1) VARCHAR2(1) NOT NULL Lease Status
1=Pending
2=Active
3=Canceled
4=Disputed
5=Expired
6=Holdover
7=Closed
8=Transferred
11 LAST_RPT_DATE Date(10) DATE Last Report Date
12 SALESRPT_TYPE Character(1) VARCHAR2(1) NOT NULL Sales Report Type
1=Missing
2=Estimated