DECLARE @AGE DATE DECLARE @BEGINDATE DATE DECLARE @ENDDATE DATE SET @AGE = '09/30/2015' SET @BEGINDATE = '10/01/2015' SET @ENDDATE = '09/30/2016' --the following clause contains returns that are partially applied: --UNION select RM20101.CUSTNMBR as [CustomerID], RM00101.CUSTNAME as [CustomerName], CN00500.USERDEF2 as [GroupBillingName], RM20101.DOCNUMBR, SUM(RM20201.APFRMAPLYAMT * -1) as [OPEN A/R], 0 as [Payments], 0 as [Credits], 0 as [Returns], 0 as [Writeoffs] from RM20101 INNER JOIN (SELECT *, ROW_NUMBER() OVER ( PARTITION BY RM20201.ApplyFromGLPostDate, RM20201.APFRMAPLYAMT ORDER BY DATE1) rn FROM RM20201 where RM20201.DATE1 >= @AGE and RM20201.APFRDCDT <= @AGE and RM20201.APTODCDT <= @AGE) RM20201 ON RM20101.CUSTNMBR = RM20201.CUSTNMBR AND RM20101.DOCNUMBR = RM20201.APFRDCNM AND RM20201.rn = 1 --INNER JOIN RM20201 ON RM20101.CUSTNMBR = RM20201.CUSTNMBR AND RM20101.DOCNUMBR = RM20201.APFRDCNM INNER JOIN RM00101 ON RM20101.CUSTNMBR = RM00101.CUSTNMBR LEFT OUTER JOIN CN00500 ON RM00101.CUSTNMBR = CN00500.CUSTNMBR where RM20201.DATE1 >= @AGE and RM20101.DOCDATE <= @AGE and RM20101.DINVPDOF >= @AGE and RM20201.APFRDCDT <= @AGE and RM20101.POSTDATE <= @AGE and RM20201.APTODCDT <= @AGE and RM20101.DUEDATE <> '' and RM20101.DUEDATE <> @AGE and RM20101.RMDTYPAL IN (8) and RM20101.VOIDSTTS = 0 and RM20101.CUSTNMBR IN ('0100014190') GROUP BY RM20101.CUSTNMBR, RM00101.CUSTNAME, CN00500.USERDEF2, RM20101.DOCNUMBR
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: