neilmcdonald
Technical User
- Aug 16, 2002
- 53
Apologies for the long-winded question below...
Our clients sign 3 year contracts and are invoiced monthly, quarterly and annually. I need to create a report to find out what income is due each month for the next 3 years. Our database stores the invoice frequency and I have calculated the last invoice date.
The only solution I can come up with is to create 36 separate formulae, one for each month which work back from the invoice date and check to see if that client will be invoiced in that month.
My formula for month 1 would be something like this:
Local NumberVar i;
For i:=1 to 36 Do
If DateAdd("m",-i,{LastInvoiceDate} in {ReportDate} to DateAdd("m",1,{ReportDate} Then
{Invoice Value} Else 0
My only problem is that the formula only ever returns TRUE or FALSE, and is ignoring the Then...Else part of the formula.
If anyone can see what's wrong (or knows a better way to do this), please let me know.
Apologies again for the question length...
Our clients sign 3 year contracts and are invoiced monthly, quarterly and annually. I need to create a report to find out what income is due each month for the next 3 years. Our database stores the invoice frequency and I have calculated the last invoice date.
The only solution I can come up with is to create 36 separate formulae, one for each month which work back from the invoice date and check to see if that client will be invoiced in that month.
My formula for month 1 would be something like this:
Local NumberVar i;
For i:=1 to 36 Do
If DateAdd("m",-i,{LastInvoiceDate} in {ReportDate} to DateAdd("m",1,{ReportDate} Then
{Invoice Value} Else 0
My only problem is that the formula only ever returns TRUE or FALSE, and is ignoring the Then...Else part of the formula.
If anyone can see what's wrong (or knows a better way to do this), please let me know.
Apologies again for the question length...