Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: YTD and LYYTD From 1st April not 1st Jan Post Reply Post New Topic
Author Message
twistednerve
Newbie
Newbie


Joined: 28 Feb 2013
Online Status: Offline
Posts: 5
Quote twistednerve Replybullet Topic: YTD and LYYTD From 1st April not 1st Jan
    Posted: 20 Jan 2014 at 5:23pm
Hi,

I have been racking my brain trying to work this out!

Does anyone have an ideas on how to return data that is YTD and LYYTD with the beginning of the year being 1st April instead of the 1st of January?

The data returned would have to be between 1st April and 31st March.

The reason for 1st of April as it is the beginning of the companies financial year.
IP IP Logged
lolly54
Groupie
Groupie
Avatar

Joined: 25 Sep 2011
Online Status: Offline
Posts: 58
Quote lolly54 Replybullet Posted: 20 Jan 2014 at 9:39pm
I have used three formulas to get the FY period.

{@CurrentMonthStart}
//1st of Current Month
Date(Year(CurrentDate),Month(CurrentDate),1)

{@FY Start}
if month({@CurrentMonthStart}) in 1 to 3 then
    Date(Year({@CurrentMonthStart})-1,4,1)
else
    Date(Year({@CurrentMonthStart}), 4, 1)

{@FY End}
if month({@CurrentMonthStart}) in 1 to 3 then
    Date(Year({@CurrentMonthStart}),4,1)-1
else
    Date(Year({@CurrentMonthStart})+1,4,1)-1

If you run the report as of today (Jan 2014), it will return the FY period from April 1st 2013 to March 31st 2014.
IP IP Logged
twistednerve
Newbie
Newbie


Joined: 28 Feb 2013
Online Status: Offline
Posts: 5
Quote twistednerve Replybullet Posted: 23 Jan 2014 at 4:52pm
Thanks for your help, it works perfectly and I learnt something about using dates
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.