Solved

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

Posted on 2013-12-27
7
1,488 Views
Last Modified: 2013-12-27
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.
0
Comment
Question by:decker587
  • 3
  • 2
  • 2
7 Comments
 
LVL 18

Expert Comment

by:vasto
Comment Utility
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.
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Do you ever have to print a statement for a previous month say the November statement in December?

mlmcc
0
 

Author Comment

by:decker587
Comment Utility
@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?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Assuming it is a date then just put it in place of CurrentDate in vasto's formula

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

mlmcc
0
 

Author Comment

by:decker587
Comment Utility
There is an error in the statement, see attached.
Crystal-Error.JPG
0
 
LVL 18

Accepted Solution

by:
vasto earned 300 total points
Comment Utility
What is the type of @statemntdate - string ?
You need to change the type to  a date - will be easier
If you want to keep it as string then use DateValue to convert it to date first

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

It will be much better if you can use date for the parameter.
Which application you use to run the reports ?
0
 

Author Closing Comment

by:decker587
Comment Utility
That works.  Thank you, vasto.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now