I want to highlight the dates in a report that are in the past. How do I compare these dates?This message has been edited. Last edited by: Kerry,
WebFOCUS 8.0.08 Solaris HTML, PDF, XLS, CSV
September 24, 2010, 12:35 PM
Darin Lee
First, the documentation is full or references and functions regarding dates. This forum is as well. Search through those for additional information. Second, &YYMD (and its variations) is the reference to the system date. It can be used in DEFINE/COMPUTE statements, WHERE statements, etc.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
And I'm just getting this error. (FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: PASS_EXPIRED
WebFOCUS 8.0.08 Solaris HTML, PDF, XLS, CSV
September 24, 2010, 02:01 PM
Prarie
What is the format of PWD_EXPIRY_DT to begin with?
Take of your noprint and the last compute and that is probably where you are really getting the error. You probably need a function to make it really MDYY
COMPUTE DATE_CREATED1/I8YYMD = DATE_CREATED; COMPUTE DATE_CHECK/A1 = IF &TDAY LT DATE_CREATED1 THEN 'Y' ELSE 'N';
WF 8 version 8.2.04. Windows. In focus since 1990.
September 24, 2010, 03:38 PM
Darin Lee
I don't think you can compare ddates in smart date format using LT, GT, etc. If you convert to alpha, it would have to be A8YYMD to compare. I think Spence's suggestion would get you what you need (he's using I8YYMD which you could use for numeric comparison operators.)
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
September 24, 2010, 03:56 PM
ABT
I have this in the define of a program that does something similar:
NEWTIME/HYYMDIA WITH TODATE=DT(&YYMD 00:00AM); NEWDAY/HYYMDS = NEWTIME;
PASSED/A1 = IF NEWDAY FROM FROMDATE TO TODATE THEN 'Y' ELSE 'N';