Solved

Crystal reports: Paramater for selecting current and last quarter dates

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

23 Experts available now in Live!

Get 1:1 Help Now