To All
Just curious if FiveWin has a FW function to calculate a Fiscal Year .. like:
dDate := ctod("06/27/2020")
nFy := Whatever_function( dDate )
nFy should = 2020
Thanks
Rick Lipkin
Fiscal Year ( fy ) Calculator
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Fiscal Year ( fy ) Calculator
Fiscal year is different in different countries.
In some countries like USA it is the calendar year, Year( dDate ) gives the fiscal year.
In some countries like Australia, it is from July to June and for some countries like India, it is from Apr to March. So the function has to be country-specific.
https://en.wikipedia.org/wiki/Fiscal_year
The tax year (called by different names in different countries) normally is the year next to the fiscal year.
I have this function for use in India. ( Apr to Mar )
This function return end of FY or first year of Tax Year.
In some countries like USA it is the calendar year, Year( dDate ) gives the fiscal year.
In some countries like Australia, it is from July to June and for some countries like India, it is from Apr to March. So the function has to be country-specific.
https://en.wikipedia.org/wiki/Fiscal_year
The tax year (called by different names in different countries) normally is the year next to the fiscal year.
I have this function for use in India. ( Apr to Mar )
Code: Select all
function FYE( dDate, lAsLabel )
local y
DEFAULT dDate := Date()
y := YEAR( dDate ) + If( MONTH( dDate ) > 3, 1, 0 )
if lAsLabel == .t.
return Str( y - 1, 4 ) + "-" + StrZero( y % 100, 2 )
endif
return y
//----------------------------------------------------------------------------//
function BOFY( dDate )
return STOD( Str( FYE( dDate ) - 1, 4 ) + "0401" )
//----------------------------------------------------------------------------//
function EOFY( dDate )
return STOD( Str( FYE( dDate ), 4 ) + "0331" )
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India