Focal Point
Finding The Fiscal Year

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8811063981

October 05, 2006, 12:35 PM
jmcgeorge
Finding The Fiscal Year
I need to find out what the current fiscal year is within a define, but I keep getting the following error: (FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR

Here is my code:
.....
DAY/A4=TODAY(DAY);
MN/A4=EDIT(DAY, '99$$$$$$$$');
YR/A4=EDIT(DAY, '$$$$$$9999');
FISCAL_YR/A4=
IF MN LT '7'
THEN YR
ELSE YR + 1; -*also tried ELSE YR + '1';
END

If I take away the '+ 1', then I have no problems, but I need to instill the following logic:
if the current month is less than 7
then give me the current year
else give me the current year + 1 (ex: 2006 + 1)

Any ideas? Thanks in advance!


Jeff
DevStudio, 5.2.6
Please be kind....I'm new at this!
October 05, 2006, 01:04 PM
Glenda
Try this code:

TODAY/A8 = '&YYMD';
DAY/A4=EDIT(TODAY, '$$$$$$99');
MN/A2=EDIT(TODAY, '$$$$99$$');
YR/A4=EDIT(TODAY, '9999$$$$');
FISCAL_YR/I4=
IF MN LT '07'
THEN EDIT(YR)
ELSE EDIT(YR) + 1;
END


Glenda


Glenda

In FOCUS Since 1990
Production 8.2 Windows
October 05, 2006, 01:15 PM
jmcgeorge
EDIT()!!!! Thank you so much! Works like a charm.


Jeff
DevStudio, 5.2.6
Please be kind....I'm new at this!
October 05, 2006, 02:44 PM
JimRice
A smart date way:

DEFINE FILE CAR
S_TODAY/YYMD = '&YYMD';
S_DAY/D = S_TODAY;
S_MN/M = S_TODAY;
S_YR/YY = S_TODAY;
F_YR/YY = IF S_MN LT 7 THEN S_YR ELSE S_YR + 1;
END
-*
TABLE FILE CAR
PRINT
CAR
S_TODAY
S_DAY
S_MN
S_YR
F_YR
WHERE RECORDLIMIT EQ 1
END


WF DevStu 5.2.6/WF Srv 5.2.4/Win NT 5.2
October 09, 2006, 08:30 PM
Piipster
So your fiscal year ends in June?

Here's an example that shows what Fiscal year an employee was hired in if the fiscal year ends in June.

DEFINE FILE EMPDATA
HIRE_YM/YYM = HIREDATE;
FISCAL_HIRE/YYM = HIRE_YM +6;
FISCAL_YEAR/YY = FISCAL_HIRE;
END
TABLE FILE EMPDATA
PRINT PIN HIRE_YM FISCAL_HIRE FISCAL_YEAR
BY HIREDATE
END


ttfn, kp


Access to most releases from R52x, on multiple platforms.