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 Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: