I need a get sum of my Customer Payment in credit Terms. I declare 3 credit Terms
- Over 45 Days
- 45 Days
- 30 Days
I Genarated a Customer Invoice my System and post the customer.then Start Days Count Invoice Create.Same Customer Not Paid last Month of past Invoices.I want to Get sum of The Unpaid Amount Using my Cridet Terms.(Separate Amount Over 45,45 Days And 30 Days).
This Is my Table.
SELECT [InvoiceNo] ,[cusCode],[InvAmt],[CreateUserID],[CreateDate],[CreateTime],[Confirm] ,[TotalPaid],[TotalDuePaid]
FROM [tblInvoiceHeader]
I try This One
SELECT TotalDuePaid,DATEDIFF(DAY, CreateDate, GETDATE()) AS DayDiff FROM tblInvoiceHeader WHERE Confirm='0' AND cusCode='1'
it's Working But i want to Select All 3 Terms in At a 1 time
EX- CusCode=1 unpaid 2 invoices,this 2 invoices are 2 days I want show this unpaid data given bellow table.
CusCode Over 45 Days 45 Days 30 Days
1 500.00 0.00 560.00
How to do it Any one can help me?