Solved

Crystal reports: Paramater for selecting current and last quarter dates

Posted on 2013-12-09
2
1,256 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IF THEN Statement not working 3 45
Crystal Reports Sub Report 4 85
Crystal Reports - Trim Data 7 51
Crystal Report sorting 6 11
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…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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