Solved

Crystal reports: Paramater for selecting current and last quarter dates

Posted on 2013-12-09
2
1,240 Views
Last Modified: 2013-12-10
Hello Experts,

I am trying to build a formula to be used in selection parameter to select the END of the "CurrentQuarter" and the "LastQuarter".  Here is what I have so far, it works fine to select the begining date , just need the last date of the quarter.

Current Formula:
else if (rptPeriod = "CURRENTQUARTER") Then
    bdt := Date(Year( Today),Month(DateAdd('m', -(Month(Today) Mod 3 + 2) mod 3, Today)),01)
else if (rptPeriod = "LASTQUARTER") Then
    bdt := Date(Year(DateAdd('m', (-(((Month(Today) Mod 3) + 2) mod 3)-3), Today)),Month(DateAdd('m', (-(((Month(Today) Mod 3) + 2) mod 3)-3), Today)),01)

bdt;
0
Comment
Question by:Maliki Hassani
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39707258
Try this

CurrentQtrStart
DateVar bdt; 
bdt := Date(Year( Today),DatePart('q',Today) * 3 - 2, 1)

Open in new window


CurrentQtrEnd
DateVar edt; 
edt := Date(DateAdd('q', 1,{@CurrentQtrStart}) - 1)

Open in new window


LastQtrStart
DateVar bdt; 
bdt := Date(DateAdd('q',-1,{@CurrentQtrStart}))

Open in new window


LastQtrEnd
DateVar edt; 
edt := {@CurrentQtrStart} - 1

Open in new window


mlmcc
0
 

Author Closing Comment

by:Maliki Hassani
ID: 39708569
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 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

11 Experts available now in Live!

Get 1:1 Help Now