Solved

Crystal Month to Date by Parameter

Posted on 2006-10-23
4
686 Views
Last Modified: 2008-02-01
Is there a way to use the MonthToDate function based on a parameter instead of the system date?

Currently I'm pulling information based on one week, I need to add a couple more entries one based on MTD, one on YTD, and finally the grand prize of LastYTD.

My weekly function looks like this:

if {JOB_CHRG.CHARGEDATE} in DateTime ({?Begining of Week}) to DateTime ({?End of Week})
and {@Billable Items}
then {JOB_CHRG.BILLAMT_LOC}
else 0

I need to use the end of Week parameter as my basis for the MTD and YTD calcuations.

Any help would be appreciated.
0
Comment
Question by:Alexziogas
  • 2
4 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 17793411
As far as I know no.

What is it you are trying to do?

Get the month through some provided date?
For example if I enter 15 Oct 2006 you want the monthly total up to 15 Oct?

For the MOnth through the end of the given week try using
 
if {JOB_CHRG.CHARGEDATE} in DateTime (Year({?End of Week}), Month({?End of Week}),1) to DateTime ({?End of Week})  and {@Billable Items}
then
    {JOB_CHRG.BILLAMT_LOC}
else
     0

Similarly for the YTD
 
if {JOB_CHRG.CHARGEDATE} in DateTime (Year({?End of Week}), 1,1) to DateTime ({?End of Week})  and {@Billable Items}
then
    {JOB_CHRG.BILLAMT_LOC}
else
     0

LastYear
if {JOB_CHRG.CHARGEDATE} in DateTime (Year({?End of Week})-1, 1,1) to DateTime (Year({?End of Week})-1, Month({?End of Week}),Day({?End of Week})) and {@Billable Items}
then
    {JOB_CHRG.BILLAMT_LOC}
else
     0

mlmcc
0
 
LVL 6

Expert Comment

by:Ken Turner
ID: 17794269
Here's a quote from the CR8.0 Help file for the MonthToDate function (and it's identical in CRXI):

"Note: If you would like to base the date range on a date other than today's date, you must either change the date via the Date/Time option in the Windows Control Panel, or change the report print date via the Set Print Date/Time command in the Report Menu."

Probably not the answer you're looking for!
0
 

Author Comment

by:Alexziogas
ID: 17796199
Thanks mlmcc!  That was exactly what I was looking for, thanks again.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17796560
Glad i could help

mlmcc
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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. …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 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