Skip to content

SQL Scripts–Invoices Coming Due Next Week

September 12, 2011

The following SQL View shows you all invoices that are coming due next week.  We use this view in conjunction with Task Centre to send out a list (fax or email) to our customers of invoices will be due next week.  This has really helped our aging process and past due invoices.  Our customers have expressed an appreciation for this friendly reminder.

***SQL Script***

select * from
(select custnmbr, docnumbr, duedate, cspornbr, docdate, ortrxamt, curtrxam from rm20101
    where duedate >= dateadd(wk, datediff(wk, 0, getdate())+1,0)-1
    and duedate < dateadd(wk, datediff(wk, 0, getdate())+2,0)-1) A
left join
(select custnmbr, custname, cntcprsn, stmtname, adrscode, address1, address2, address3, city, state, zip, phone1, phone2, phone3, fax, slprsnid, pymtrmid from rm00101) B
on a.custnmbr = b.custnmbr
left join
(select customer_num, invoiceStatementTo from spvcustomer) C
on a.custnmbr = c.customer_num
order by a.custnmbr asc, a.docnumbr asc

From → Dynamics GP, SQL

Leave a comment