Solved

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

Posted on 2013-12-27
7
1,567 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 100

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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 100

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 300 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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. …
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

739 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