Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Fiscal Year calculations 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: Fiscal Year calculations
     Posted: 22 Aug 2011 at 9:56am
I have a report that needs to run on transaction post date for our FY12 which is 5/1/2011 - 4/30/2012.
 
This will be a scheduled report that will run on the 5th of each month.
 
The criteria for the report is very simple:
{RECORD.TRX_POSTING_DT} in DateTime (2011, 05, 01, 00, 00, 00) to DateTime (2012, 04, 30, 23, 59, 59) and
{RECORD.TRX_PROC_NO} in [117, 118, 119, 121, 621]
 
Example on Sept 5th the report will run and I only want it to pick up records that have the transaction post date of 5/1/2011-08/31/2012 but because the transaction post date is set up in the criteria for FY12 the report will pick up records we do not want.
 
Example on Sept 5th the report will run and I only want it to pick up records that have the transaction post date of 5/1/2011 00:00:00 -08/31/2012 11:59:59
 
What can I do to accomplish this?
 
 
Paula J
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 23 Aug 2011 at 3:05am
i gather the criteria is in the record selection, you can try a conditional supression in the section expert or you can try a group selection formula, forget if that overrides a record selection.
if you need to sum values create a formula
if date in 5/1/2011 00:00:00 -08/31/2012 11:59:59 then {field}
 
sharona
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Aug 2011 at 3:37am
why create a formula in the record selection...as Sharona alluded to.
something like:
local numbervar aYear := Year(CurrentDate);
local datetime endDate := CurrentDate;
endDate := CDate(MONTH(endDate), 1, YEAR(endDate);  //first of the month
endDate := DateAdd("d", -1, endDate);  //last day of previous month
 
if MONTH(endDate) < 5 then aYear := aYear - 1;  //adjust the fiscal year
 
{table.dateField} in CDate(5, 1, aYear) to endDate
 
 
this will return a true or false, if true, the record is in the dataset, if false it is excluded.

HTH


Edited by lockwelle - 23 Aug 2011 at 3:38am
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: 19 Sep 2011 at 10:09am

Thanks for your help.

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