Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-12-27
7
Medium Priority
?
1,601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 18

Expert Comment

by:vasto
ID: 39742237
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 101

Expert Comment

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

mlmcc
0
 

Author Comment

by:decker587
ID: 39742269
@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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 101

Expert Comment

by:mlmcc
ID: 39742274
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
ID: 39742290
There is an error in the statement, see attached.
Crystal-Error.JPG
0
 
LVL 18

Accepted Solution

by:
vasto earned 1200 total points
ID: 39742357
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
ID: 39742382
That works.  Thank you, vasto.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

718 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