N
Newbie
Hi,
I have the following query that works ok but I would like to be able to show
invoices that are older than 1 year if they are still outstanding
For eg
Report will have 14 columns
1 for each month
1 for Total O/S, and
1 for Invoices older than 1 year
At the moment the query just reports on invoices for the past year
How can I amend this to include the really late payers
FYI Here is what I have so far
PARAMETERS [forms]![frmSalesDates]![txtDateEnd] DateTime;
TRANSFORM Sum(Round([InvoiceBal1],2)) AS Expr2
SELECT ArInvoice.Customer, ArCustomer.Name, ArCustomer.Branch,
Round(Abs(Sum(([InvoiceDate]>=DateAdd("yyyy",-1,forms!frmSalesDates!txtDateE
nd) And [InvoiceDate]<=forms!frmSalesDates!txtDateEnd)*[InvoiceBal1])),2) AS
[Total O/S]
FROM ArCustomer INNER JOIN ArInvoice ON ArCustomer.Customer =
ArInvoice.Customer
GROUP BY ArInvoice.Customer, ArCustomer.Name, ArCustomer.Branch
PIVOT "Mth" & DateDiff("m",[InvoiceDate],forms!frmSalesDates!txtDateEnd) In
("Mth0","Mth1","Mth2","Mth3","Mth4","Mth5","Mth6","Mth7","Mth8","Mth9","Mth1
0","Mth11");
Thanks
I have the following query that works ok but I would like to be able to show
invoices that are older than 1 year if they are still outstanding
For eg
Report will have 14 columns
1 for each month
1 for Total O/S, and
1 for Invoices older than 1 year
At the moment the query just reports on invoices for the past year
How can I amend this to include the really late payers
FYI Here is what I have so far
PARAMETERS [forms]![frmSalesDates]![txtDateEnd] DateTime;
TRANSFORM Sum(Round([InvoiceBal1],2)) AS Expr2
SELECT ArInvoice.Customer, ArCustomer.Name, ArCustomer.Branch,
Round(Abs(Sum(([InvoiceDate]>=DateAdd("yyyy",-1,forms!frmSalesDates!txtDateE
nd) And [InvoiceDate]<=forms!frmSalesDates!txtDateEnd)*[InvoiceBal1])),2) AS
[Total O/S]
FROM ArCustomer INNER JOIN ArInvoice ON ArCustomer.Customer =
ArInvoice.Customer
GROUP BY ArInvoice.Customer, ArCustomer.Name, ArCustomer.Branch
PIVOT "Mth" & DateDiff("m",[InvoiceDate],forms!frmSalesDates!txtDateEnd) In
("Mth0","Mth1","Mth2","Mth3","Mth4","Mth5","Mth6","Mth7","Mth8","Mth9","Mth1
0","Mth11");
Thanks