Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Financial Year date functions

Status
Not open for further replies.

Danster

Technical User
May 14, 2003
148
AU
Gday all,
Using CR8.5. I love the inbuilt report functions YearToDate, LastYearYTD but they work on calendar year.

Is there a simple way to get the same functionality for financial years? 1 July thru to 30 June.

cheers

Danster
 
and further, if I use Calendar1stHalf and Calendar2ndHalf functions, can I get a function to say LastYearCalendar1stHalf, LastYearCalendar2ndHalf?

I basically need to compare financial years and specifically for this report comparing FY 2002-2003 and 2003-2004.

My report will display almost exactly as the Crystal Help file examples show for these date functions i.e
IF {Orders.DateField} IN Calendar1stHalf THEN
{Orders.Amount}
ELSE
0

cheers

Danster
 
It would be simpler to create formulas like the following than it would be to modify the built-in functions:

//{@firsthalfcurrFY}:
if {table.date} in date({?year}-1, 07, 01) to date({?year}-1, 12,31) then {table.amount}

//{@secondhalfcurrFY}:
if {table.date} in date({?year}, 01, 01) to date({?year}, 06,30) then {table.amount}

//{@firsthalfprevFY}:
if {table.date} in date({?year}-2, 07, 01) to date({?year}-2, 12,31) then {table.amount}

//{@secondhalfprevFY}:
if {table.date} in date({?year}-1, 01, 01) to date({?year}-1, 06,30) then {table.amount}

...where {?year} is the ending year of the current fiscal year.

-LB

 
Danster,

You are also plagued with a financial year that is not the standard in North America.

You can create your own custom groups:

Create this formula:

if Month({Orders.DateField}) in [1,2,3,4,5,6] then
"Calendar 2nd Half"
else
"Calendar 1st Half"

then group on this formula - in your record selection just specify the Year(s) you wish to show.

I hope this helps

Cheers,

paulmarr
 
lbass,
We must be on the same wavelength...I did that exact thing to get what I was after after I posted my question. I just didn't think about it long enough & posted in haste!

In fact, I wanted to put in a reply to tell people that I've worked it out.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top