N
Newbie
Office 2003
I want to create a report similar to an aged debt report. I want the
columns to be
0-14 days
15-30 days
31-60 days
61-90 days
90 days and over
I have the following (amended from a post I found by Duane) but am not sure
how to do the pivot section.
The DateDiff("d",[tDate],forms!frmDate.dtpFrom)/30)*30)) line that was part
of the original post didn't work as it didn't show the amounts in any column
when the result of the days was not in the Mth0 or Mth90 column
What do I need to do?
Thanks
PARAMETERS Forms!frmDate.dtpFrom DateTime;
TRANSFORM Sum(Debtors.AmountOS) AS TotalOS
SELECT Debtors.Acc, Debtors.AccName, Debtors.InvNo, Debtors.Note
FROM Debtors
GROUP BY Debtors.Acc, Debtors.AccName, Debtors.InvNo, Debtors.Note
PIVOT "Mth" &
IIf(DateDiff("d",[tDate],forms!frmDate.dtpFrom)>90,"90",iif(DateDiff("d",[tDate],forms!frmDate.dtpFrom)<15,
"14",
(DateDiff("d",[tDate],forms!frmDate.dtpFrom)/30)*30)) In ("Mth14","Mth30",
"Mth60","Mth90");
I want to create a report similar to an aged debt report. I want the
columns to be
0-14 days
15-30 days
31-60 days
61-90 days
90 days and over
I have the following (amended from a post I found by Duane) but am not sure
how to do the pivot section.
The DateDiff("d",[tDate],forms!frmDate.dtpFrom)/30)*30)) line that was part
of the original post didn't work as it didn't show the amounts in any column
when the result of the days was not in the Mth0 or Mth90 column
What do I need to do?
Thanks
PARAMETERS Forms!frmDate.dtpFrom DateTime;
TRANSFORM Sum(Debtors.AmountOS) AS TotalOS
SELECT Debtors.Acc, Debtors.AccName, Debtors.InvNo, Debtors.Note
FROM Debtors
GROUP BY Debtors.Acc, Debtors.AccName, Debtors.InvNo, Debtors.Note
PIVOT "Mth" &
IIf(DateDiff("d",[tDate],forms!frmDate.dtpFrom)>90,"90",iif(DateDiff("d",[tDate],forms!frmDate.dtpFrom)<15,
"14",
(DateDiff("d",[tDate],forms!frmDate.dtpFrom)/30)*30)) In ("Mth14","Mth30",
"Mth60","Mth90");