Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Performance Years Post Reply Post New Topic
Author Message
gaby
Newbie
Newbie


Joined: 23 Aug 2012
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote gaby Replybullet Topic: Performance Years
     Posted: 11 Apr 2013 at 5:15am
Hi

I'd like to create a formula field that tells me which performance year events are falling within. The format of our event dates is dd/mm/yyyy hh:mm:ss so essentially is the event happens on 01/05/2012 at 08:00:00 I want the formula result to say 2012/13

Not sure how to go about this?

Thanks
Gaby
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Apr 2013 at 6:14am
totext(table.field,'yyyy/')&totext(dateadd('yyyy',1,table.field),'yy')
IP IP Logged
gaby
Newbie
Newbie


Joined: 23 Aug 2012
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote gaby Replybullet Posted: 11 Apr 2013 at 10:03pm
Hi

That works great, but it changes the year in the January in there a way I can make it change in the April?

Thanks
IP IP Logged
joeg1962
Newbie
Newbie


Joined: 01 Mar 2013
Location: United States
Online Status: Offline
Posts: 35
Quote joeg1962 Replybullet Posted: 12 Apr 2013 at 2:01am
You need to show more detail. In your example, Jan of 2012 was to be shown as 2012/13.
So March 2012 is ??
April 2012 is ??
May 2012 is ??

Based on your example in the initial posting, it is unclear what would/should happen in April (your follow-up post).
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Apr 2013 at 11:14am
try using dateadd with moonth values to 'shift your FY dates to match calendar years'.
maybe this...?
 
totext(dateadd('m',-3,table.field),'yyyy/')&totext(dateadd('m',9,table.field),'yy')
IP IP Logged
gaby
Newbie
Newbie


Joined: 23 Aug 2012
Location: United Kingdom
Online Status: Offline
Posts: 11
Quote gaby Replybullet Posted: 15 Apr 2013 at 3:00am
I think we might have a UK/US date confusion joeg1962 my date example in my first post to me is 1st may 2012 and I think you're reading it as 5th Jan 2012. The 1st May 2012 falls in the UK tax year 2012/13 as it's after April, we run a 1st April to 31st March tax year (or fiscal year in the US I believe). So what I am hoping for using a formula is all dates between 1st April 2012 and 31st march 2013 to show as 2012/13 etc for all the different tax years.

DBlank that work perfectly, thank you!
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