Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: date formula 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: date formula
    Posted: 12 Mar 2013 at 5:51am
I have a report that pulls data based on the posting date of the transaction.
I want to set the report up so that I do not have to modify the posting date each month when I run the report.  Currenly I am running the report for the previous fiscial year (2012) which for our company runs 5/1/11 to 4/30/2012.  In May 2013 I will start running the report for fy 2013..5/1/12 to 4/30/2013.
I run the report on the 2nd of each month.
The criteria for the report I ran on 3/2/13 is:
{trx_amt.record}<>0.00 and
{trx_proc_no.record}in[12321, 19824] and
[trx_posting_dt.record] in DateTime (2011,05,01,00,00,00) to DateTime (2012,02,28,23,59,59)
 
How can I set this up using the trx_posting_dt.record so at the minimum I only have to set up the date once a year and the ultimate would be so I would never have to update the date. 
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2013 at 6:18am

one way

year(dateadd('m',-4,currentdate))-1=year(dateadd('m',-4,trx_posting_dt.record))
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: 12 Mar 2013 at 9:18am
This works but is not what I am looking for. 
Report date 3/2/13: I enter beginning trx_posting_dt 5/1/11 and end trx_post_date 2/29/12.
So on 4/2/13 the dates I enter will be 5/1/11 and 3/31/12
on 5/2/13 the dates I enter will be 5/1/11 and 4/30/12
on 6/2/13 the dates I etner will be 5/1/12 and 5/31/12
on 7/2/13 the date I enter will be 5/1/12 and 6/30/12.
 
Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2013 at 9:31am
you want prior fiscal year start through last full month in the prior fy?

Edited by DBlank - 12 Mar 2013 at 9:31am
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: 12 Mar 2013 at 9:36am

correct...noting that our fiscial years run April to May.

Paula J
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2013 at 10:28am
year(dateadd('m',-4,currentdate))-1=year(dateadd('m',-4,trx_posting_dt.record))
and
month(dateadd('m',-4,currentdate))>month(dateadd('m',-4,trx_posting_dt.record))
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Mar 2013 at 10:29am
You can also use an imbedded if-then statement in a dateserial formula if you prefer
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: 13 Mar 2013 at 8:19am
Thanks so much for the help.  This works for me!
Paula J
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.