Hi
I'm using Crystal 8.5 and I need to create a formula to show the 3rd bill date from the accounts table which contains both credit and debit fields. The report needs to display a formula, ThirdPaidBill, which will be the date when the 3rd payment (credit) was made assuming all 3 bills have been made.
Here's an example of the neat data.
CustomerID Credit Debit Date InvNo
1000000020 NULL 20.00 01/05/2002 50123
1000000020 10.00 NULL 03/05/2002 50123
1000000976 NULL 43.00 04/05/2002 50144
1000000020 10.00 NULL 06/05/2002 50123
1000000020 NULL 20.00 08/05/2002 50161
1000000020 20.00 NULL 14/05/2002 50161
1000000020 NULL 20.00 15/05/2002 50172
1000000976 43.00 NULL 04/05/2002 50144
1000000020 20.00 NULL 16/05/2002 50172
I am attempting to generate a report and would like to show the following for customer 1000000020.
CustomerID 1stCreditDate 2ndCreditDate 3rdCreditDate
1000000020 03/05/2002 06/05/2002 14/05/2002
The following shows the formula I am using to try and get the FirstCreditDate
WhilePrintingrecords;
numbervar FirstCreditDateCount;
If not isnull({Accounts.Credit}) then
FirstCreditDateCount:=FirstCreditDateCount+1;
If FirstCreditDateCount = 1 Then
{Accounts.Date}
I can't seem to modify for the 2nd and 3rd Bill dates.
What is wrong? Is there an easier solution?
Thanks in advance
Sara
I'm using Crystal 8.5 and I need to create a formula to show the 3rd bill date from the accounts table which contains both credit and debit fields. The report needs to display a formula, ThirdPaidBill, which will be the date when the 3rd payment (credit) was made assuming all 3 bills have been made.
Here's an example of the neat data.
CustomerID Credit Debit Date InvNo
1000000020 NULL 20.00 01/05/2002 50123
1000000020 10.00 NULL 03/05/2002 50123
1000000976 NULL 43.00 04/05/2002 50144
1000000020 10.00 NULL 06/05/2002 50123
1000000020 NULL 20.00 08/05/2002 50161
1000000020 20.00 NULL 14/05/2002 50161
1000000020 NULL 20.00 15/05/2002 50172
1000000976 43.00 NULL 04/05/2002 50144
1000000020 20.00 NULL 16/05/2002 50172
I am attempting to generate a report and would like to show the following for customer 1000000020.
CustomerID 1stCreditDate 2ndCreditDate 3rdCreditDate
1000000020 03/05/2002 06/05/2002 14/05/2002
The following shows the formula I am using to try and get the FirstCreditDate
WhilePrintingrecords;
numbervar FirstCreditDateCount;
If not isnull({Accounts.Credit}) then
FirstCreditDateCount:=FirstCreditDateCount+1;
If FirstCreditDateCount = 1 Then
{Accounts.Date}
I can't seem to modify for the 2nd and 3rd Bill dates.
What is wrong? Is there an easier solution?
Thanks in advance
Sara