M
mhill31
The receivables aging report (based on an SQL statement and a query) i
set to run based on Date(). I want to enter an aging date. Example
it is November 17 but I want to see the Aging report as of 10/31/03.
How can I change the SQL statement (or anything else) so that I ca
input the aging date I want. I tried replacing Date() with [Agin
Date] but it did not seem to work. Here is the SQL code as i
originally appears in the db:
SELECT DISTINCTRO
Sum(IIf((Date()-[ShippedDate])<31,[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [Current], Sum(IIf((Date()-[ShippedDate])<61 An
(Date()-[ShippedDate]>30),[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [31-60 Days], Sum(IIf((Date()-[ShippedDate])<91 An
(Date()-[ShippedDate]>60),[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [61-90 Days]
Sum(IIf((Date()-[ShippedDate])>90,[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [91+Days]
Sum([LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Total Payments])) A
Balance, [Receivables Aging Report Query].Company FROM [Receivable
Aging Report Query] WHERE ((([Receivables Aging Repor
Query].ShippedDate) Is Not Null)) GROUP BY [Receivables Aging Repor
Query].Company HAVIN
(((Sum([LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments])))>0));
Thank you for any help you can provide
set to run based on Date(). I want to enter an aging date. Example
it is November 17 but I want to see the Aging report as of 10/31/03.
How can I change the SQL statement (or anything else) so that I ca
input the aging date I want. I tried replacing Date() with [Agin
Date] but it did not seem to work. Here is the SQL code as i
originally appears in the db:
SELECT DISTINCTRO
Sum(IIf((Date()-[ShippedDate])<31,[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [Current], Sum(IIf((Date()-[ShippedDate])<61 An
(Date()-[ShippedDate]>30),[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [31-60 Days], Sum(IIf((Date()-[ShippedDate])<91 An
(Date()-[ShippedDate]>60),[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [61-90 Days]
Sum(IIf((Date()-[ShippedDate])>90,[LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments]),0)) AS [91+Days]
Sum([LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Total Payments])) A
Balance, [Receivables Aging Report Query].Company FROM [Receivable
Aging Report Query] WHERE ((([Receivables Aging Repor
Query].ShippedDate) Is Not Null)) GROUP BY [Receivables Aging Repor
Query].Company HAVIN
(((Sum([LineTotal]*(1+[SalesTaxRate])+[Freight]-nz([Tota
Payments])))>0));
Thank you for any help you can provide