Focal Point
[SOLVED] Date in Title
February 15, 2010, 04:02 PM
neuro [SOLVED] Date in Title
Is this possible? I cannot get the NEWDATE12 to be the actual TITLE.
DEFINE FILE ACTFORMS
CURDATE/YYMD=&YYMD;
NEWDATE12/YYM=DATEADD(CURDATE,'M',-12);
END
TABLE FILE ACTFORMS
PRINT
ORDERS_MINUS12 AS '
BY FORM# END Thanks WEBFOCUS 7.6.8
This message has been edited. Last edited by: Kerry , February 22, 2010 01:03 PM Currenly working @ Learning Circle Education Services Previously worked @ Nationwide Insurance Prod: WebFOCUS 7.6.11 Test: WebFOCUS 7.6.11 Dev: WebFOCUS 7.6.11
February 15, 2010, 04:20 PM
Waz To get the value of NEWDATE12 to be in the title, you will need to have an extra step to save the value, and -READ it into a &var.
e.g.
TABLE FILE ACTFORMS
SUM MAX.NEWDATE12
ON TABLE SAVE AS MY_DATE
END
-RUN
-READ MY_DATE &DateVar.A6.
Then use the variable in the title.
ORDERS_MINUS12 AS '&DateVar BY FORM#'
Also when you post code, use the
[CODE] [/code] tag, so the post does not get screwed up.
Waz... Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Pity the lost knowledge of an old programmer!
February 15, 2010, 05:19 PM
njsden Hi neuro, if your date is entirely dependent on your system's current date you may also try calculating NEWDATE12 as follows:
-SET &NEWDATE12 = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12), 'YYMD', 'A8YYMD');
TABLE FILE ACTFORMS
PRINT
ORDERS_MINUS12 AS '&NEWDATE12'
BY FORM#
END
What both Waz's suggestion and this one tell you is that you cannot embed a data field value inside of a TITLE the same way you do it in a HEADING, SUBHEAD, etc. The way to do it is by using dialog manager &variables which can be either data-driven (Waz's approach) or, in simple cases, environment-based. Just pick the one that makes the most sense to your case.
Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2Test: Dev. Studio 8008 /Windows 7 (Local) Output: HTML, EXL2K. February 16, 2010, 02:07 PM
neuro Okay, I think have it. Except I am trying to get a friendly format and have the following which is not working:
-SET &NEWDATE12 = CHGDAT('I8YYMD', 'MXYY',DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','I8YYMD'), 'A17');
Currenly working @ Learning Circle Education Services Previously worked @ Nationwide Insurance Prod: WebFOCUS 7.6.11 Test: WebFOCUS 7.6.11 Dev: WebFOCUS 7.6.11
February 16, 2010, 02:47 PM
Francis Mariani Try in two steps:
-SET &DT1A = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','A8YYMD');
-SET &NEWDATE12 = CHGDAT('YYMD', 'MXYY', &DT1A, 'A17');
-TYPE &DT1A
-TYPE &NEWDATE12 DATECVT and DATEADD are "Standard Date and Time Functions", while CHGDAT is a "Legacy Date Function".
Others may post slightly different methods...
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 16, 2010, 03:12 PM
njsden quote:
-SET &NEWDATE12 = DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12), 'YYMD', 'A8YYMD');
neuro, by leaving the expression exactly as I provided you with originally it should be easy to wrap it with CHGDAT to obtain the value you expect:
-SET &NEWDATE12 = CHGDAT('YYMD', 'MXYY', DATECVT(DATEADD(DATECVT(&YYMD, 'I8YYMD', 'YYMD'), 'M', -12),'YYMD','A8YYMD'), 'A17');
Gives you:
FEBRUARY 2009 The key there is to use
A8YYMD as the output format in the outer DATECVT function and
YYMD as the input format to CHGDAT.
Regards,
- Neftali.
Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2Test: Dev. Studio 8008 /Windows 7 (Local) Output: HTML, EXL2K. February 16, 2010, 03:31 PM
Dan Satchell Another alternative:
-SET &CURMTH = EDIT(&DATEYYM,'9999$99');
-SET &NEWDATE = AYM(&CURMTH,-12,'I6');
-SET &OUTDATE = CHGDAT('YYM','MXYY',&NEWDATE,'A17');
This message has been edited. Last edited by: Dan Satchell , February 16, 2010 03:39 PM WebFOCUS 7.7.05
February 16, 2010, 04:31 PM
Waz There are a host of Date variables, one of them may help.
-TYPE &|DATE : &DATE
-TYPE &|DATED : &DATED
-TYPE &|DATEDMtrYY : &DATEDMtrYY
-TYPE &|DATEDMY : &DATEDMY
-TYPE &|DATEDMYY : &DATEDMYY
-TYPE &|DATEDwMtrYY : &DATEDwMtrYY
-TYPE &|DATEJ : &DATEJ
-TYPE &|DATEJUL : &DATEJUL
-TYPE &|DATEM : &DATEM
-TYPE &|DATEMDwtYY : &DATEMDwtYY
-TYPE &|DATEMDWtrY : &DATEMDWtrY
-TYPE &|DATEMDY : &DATEMDY
-TYPE &|DATEMDYY : &DATEMDYY
-TYPE &|DATEMt : &DATEMt
-TYPE &|DATEMT : &DATEMT
-TYPE &|DATEMtDwY : &DATEMtDwY
-TYPE &|DATEMtrDYY : &DATEMtrDYY
-TYPE &|DATEMtrDwtYY : &DATEMtrDwtYY
-TYPE &|DATEMTDWTRYY : &DATEMTDWTRYY
-TYPE &|DATEMtr : &DATEMtr
-TYPE &|DATEMTr : &DATEMTr
-TYPE &|DATEMTR : &DATEMTR
-TYPE &|DATEMTRDwY : &DATEMTRDwY
-TYPE &|DATEMTRDY : &DATEMTRDY
-TYPE &|DATEMTY : &DATEMTY
-TYPE &|DATEMTrYY : &DATEMTrYY
-TYPE &|DATEMY : &DATEMY
-TYPE &|DATEMYY : &DATEMYY
-TYPE &|DATEQ : &DATEQ
-TYPE &|DATEQY : &DATEQY
-TYPE &|DATEQYY : &DATEQYY
-TYPE &|DATEW : &DATEW
-TYPE &|DATEwJ : &DATEwJ
-TYPE &|DATEWJ : &DATEWJ
-TYPE &|DATEWt : &DATEWt
-TYPE &|DATEWT : &DATEWT
-TYPE &|DATEWtr : &DATEWtr
-TYPE &|DATEWTr : &DATEWTr
-TYPE &|DATEWTR : &DATEWTR
-TYPE &|DATEY : &DATEY
-TYPE &|DATEYBMBD : &DATEYBMBD
-TYPE &|DATEYM : &DATEYM
-TYPE &|DATEYMDWT : &DATEYMDWT
-TYPE &|DATEYQ : &DATEYQ
-TYPE &|DATEYY : &DATEYY
-TYPE &|DATEYYQ : &DATEYYQ
-TYPE &|DATEYMD : &DATEYMD
-TYPE &|DATEYYJ : &DATEYYJ
-TYPE &|DATEYYJUL : &DATEYYJUL
-TYPE &|DATEYYM : &DATEYYM
-TYPE &|DATEYYMD : &DATEYYMD
-TYPE &|DATEYYMDW : &DATEYYMDW
-TYPE &|DATEYYMtrD : &DATEYYMtrD
-TYPE &|DATEYYMtrDW : &DATEYYMtrDW
For example:
&DATEMTrYY gives you FEBRUARY, 2010
Waz... Prod: WebFOCUS 7.6.10/8.1.04 Upgrade: WebFOCUS 8.2.07 OS: Linux Outputs: HTML, PDF, Excel, PPT In Focus since 1984 Pity the lost knowledge of an old programmer!
February 16, 2010, 05:18 PM
neuro Thank you that worked!
Currenly working @ Learning Circle Education Services Previously worked @ Nationwide Insurance Prod: WebFOCUS 7.6.11 Test: WebFOCUS 7.6.11 Dev: WebFOCUS 7.6.11
February 17, 2010, 12:47 AM
njsden quote:
There are a host of Date variables, one of them may help
Waz, that list of variables is great and useful. I'll make sure I'll bookmark it for future reference!
Thanks,
Neftali.
Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2Test: Dev. Studio 8008 /Windows 7 (Local) Output: HTML, EXL2K. February 28, 2010, 10:11 AM
FrankDutch yes for me too....
Frank prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
September 15, 2010, 09:36 AM
Ted Michalski Waz, which one of these formats will return this exact format: Sep-10
7.7.02 Windows EXCEL, PDF, CSV, TEXT
September 15, 2010, 09:45 AM
GamP That date representation is a custom one, easily created out of one of the standards:
-SET &MYDATE = EDIT(&DATEMtDwY,'999$-$$$99');
-TYPE &MYDATE
GamP
- Using AS 8.2.01 on Windows 10 - IE11. in Focus since 1988
September 15, 2010, 09:48 AM
Ted Michalski Thanks GamP. works great. Looks like I'm going to have to cough up the 25 bucks and buy that date format book.
7.7.02 Windows EXCEL, PDF, CSV, TEXT
September 15, 2010, 09:50 AM
GamP As Frank already said, that book costs only 25 $ is is worth every one of them.
GamP
- Using AS 8.2.01 on Windows 10 - IE11. in Focus since 1988