Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: formula/parameters Post Reply Post New Topic
Author Message
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Topic: formula/parameters
     Posted: 11 Feb 2013 at 10:13am
Current have a report set up with the following criteria to run on the 25th of Feb 2013
{PD_CDDPDRACCMAS_RECORD.CH_DIS_DT} in DateTime (2012, 06, 01, 00, 00, 00) to DateTime (2012, 11, 30, 23, 59, 59) and
{PD_CDDPDRATRANS_RECORD.TRX_COST_CTR} in [7250, 7251]
 
I need this report indefinatley to run on the 25th of each month.
 
I want to be able to schedule the report so I need to figure out a way for the discharge dates (ch_dis_dt) to advance without manually  doing it and take into consideration that the year will also change within the criteria as well as on the schedule date. 
 
I assume I need to do this in the parameters and then add to the formula but I'm not sure how to go about this.
 
Below is a list showing the date the report is to run and then the beginning ch_dis_dt and the ending ch_dis_dt for each month it is to run but again this is indefinately so the run dates will be 2014, 2015, etc so I am looking for something that I will never have to change the dates no matter what year the report is running in. 
 

Feb 2013   06/01/2012-11/30/2012

Mar 2013   07/01/2012-12/31/2012

Apr 2013   08/01/2012-01/31/2013

May 2013   09/01/2012-02/28/2013

Jun 2013   10/01/2012-03/31/2013

Jul 2013   11/1/2013-04/30/2013

Aug 2013   12/1/2013-05/31/2013

Sep 2013   01/01/2013-06/30/2013

Oct 2013   02/01/2013-07/31/2013

Nov 2013   03/01/2013-08/31/2013

Dec 2013   04/01/2013-09/30/2013

Jan 2014   05/01/2013-10/31/2013

 
 
 
 
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Feb 2013 at 10:48am
datepart('d',currentdate)=25
and
{PD_CDDPDRACCMAS_RECORD.CH_DIS_DT} in
Dateserial(year(currentdate),month(currentdate)-8,1) to Dateserial(year(currentdate),month(currentdate)-2,1-1)
{PD_CDDPDRATRANS_RECORD.TRX_COST_CTR} in [7250, 7251]
IP IP Logged
Paula J
Groupie
Groupie
Avatar

Joined: 22 Aug 2011
Location: United States
Online Status: Offline
Posts: 51
Quote Paula J Replybullet Posted: 25 Feb 2013 at 4:25am
Thanks...this is exactly what I needed.
Paula J
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum