I am trying to sum the results of a datediff formula where the dates are a max of dates based on a condition. I'm trying to determine the average number of days to pay for a customer. I'm using a variable to evaluate and reset the number of days by customer but the evaluation formula is returning "False" instead of a value.
Reading invoice and cash receipt transactions
Grouped by:
Customer
Job
Invoice#
Formulas:
@InvDate - if {transtype} = "Invoice" then AcctngDate
@CRDate - if {transtype} = "Cash receipt" the AcctngDate
@MaxInvDate - maximum(Invdate)
@MaxCRDate - maximum(CRDate)
@daystopay - datediff("d",@MaxInvDate,@MaxCRDate)
@reset - placed in customer group
Whileprintingrecord;
global numbervar SumofDays: =0;
@eval - placed in invoice group
Whileprintingrecords;
global numbervar SumofDays;
SumofDays = SumofDays + @DaystoPay;
@display - placed in customer footer
Whileprintingrecords;
global numbervar SumofDays;
Reading invoice and cash receipt transactions
Grouped by:
Customer
Job
Invoice#
Formulas:
@InvDate - if {transtype} = "Invoice" then AcctngDate
@CRDate - if {transtype} = "Cash receipt" the AcctngDate
@MaxInvDate - maximum(Invdate)
@MaxCRDate - maximum(CRDate)
@daystopay - datediff("d",@MaxInvDate,@MaxCRDate)
@reset - placed in customer group
Whileprintingrecord;
global numbervar SumofDays: =0;
@eval - placed in invoice group
Whileprintingrecords;
global numbervar SumofDays;
SumofDays = SumofDays + @DaystoPay;
@display - placed in customer footer
Whileprintingrecords;
global numbervar SumofDays;