Focal Point
SDATEY question

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

May 12, 2006, 02:25 PM
rc
SDATEY question
Using SDATEY in my heading to display the current year. Need to subtract two years from SDATEY so I can get 2004 in my heading. Hate to ask such a dumb question but how do you do that? Haven't been able to find it in the help.
May 12, 2006, 02:43 PM
Prarie
DEFINE FILE WHATERVER
NEWYEAR/YY = SDATEY - 2;
END


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
how is it used?
Heading
"Submissions 1/1/ NEWYEAR Through &SDATEM &SDATEY"
USED THE ABOVE SYNTEX AND GOT
quote:
YY = SDATEY - 2;

FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: SDATEY
DEFINE FILE CAR
NEWYEAR/YY = SDATEY - 2;
END

TABLE FILE CAR
PRINT MODEL NEWYEAR
END
-RUN

No good.

0 ERROR AT OR NEAR LINE 3 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: SDATEY
0 ERROR AT OR NEAR LINE 7 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: NEWYEAR
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT
try this,

DEFINE FILE GGSALES
DT/YY=DATE;
DT1/YY=DT - 2;
END

TABLE FILE GGSALES
PRINT DATE DT DT1
WHERE RECORDLIMIT EQ 5
END
-EXIT


WFConsultant

WF 8105M on Win7/Tomcat
try this.

-SET &CY = EDIT(&DATEYYMD,'9999$$$$');
-SET &PY = &CY - 2;


WF 8 version 8.2.04. Windows.
In focus since 1990.
I thought your Date was already just a year...their examples should help.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Works great.
How can I get the current date 5/12/06 ?
TODAY/MDYY = '&DATEMDYY';


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
&DATE works great in the heading
FYI - You should check out the book (almost) 1001 Ways to Work with Dates in WebFOCUS at www.aviter.com. Gives numerous examples of working with dates including legacy, time stamp dates, and all kinds of conversions. Also includes calculating aging examples and time zone changes. Has a CD with all examples that can be used in your code.


Vivian Perlmutter
Aviter, Inc.


WebFOCUS Keysheet Rel. 8.0.2
(Almost) 1001 Ways to Work with Dates thru Rel. 8.0.2
Focus since 1982
WebFOCUS since the beginning
Vivian@aviter.com