Link to home
Start Free TrialLog in
Avatar of decker587
decker587Flag for United States of America

asked on

Add formula for fixed due date to crystal report using system date

Currently I have to edit a crystal report we use for customer statements every month to change the due date. i.e. December 2013 invoices will be due 01/10/2014.  Is there a formula to use the system date to generate the due date?

Statements are printed the first of each month and are due by the 10th of the same month.
Also, if you "reprinted" the statement for that month on a day past the 10th, the due date would still be the 10th.
Avatar of vasto
vasto
Flag of United States of America image

this will return the 10th of the current month, current year

DateValue(Year(CurrentDate),Month(CurrentDate),10)

However , a better approach will be to create a parameter and provide the value from the calling application - you might need to print the reports for the next month.
Avatar of Mike McCracken
Mike McCracken

Do you ever have to print a statement for a previous month say the November statement in December?

mlmcc
Avatar of decker587

ASKER

@mlmcc, yes there is the 1% where we have to print a previous month.

@vasto, That does work, but you're right it would work better if it calculated the value off the running application.  Is there a way to use the statement date parameter (@statementdate) to calculate the due date?
Assuming it is a date then just put it in place of CurrentDate in vasto's formula

DateValue(Year({@statementdate}),Month({@statementdate}),10)

mlmcc
There is an error in the statement, see attached.
Crystal-Error.JPG
ASKER CERTIFIED SOLUTION
Avatar of vasto
vasto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That works.  Thank you, vasto.