Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Compare Date in report to Current Date
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Compare Date in report to Current Date
 Login/Join
 
Gold member
posted
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
 
Posts: 55 | Registered: September 08, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Gold member
posted Hide Post
Well this is what I have been trying.
  
COMPUTE CURR_DATE/MDYY='&DATEMDYY'; NOPRINT
COMPUTE PASS_EXPIRED/MDYY=PWD_EXPIRY_DT; NOPRINT
COMPUTE SHOWEXPIRED/A1=IF PASS_EXPIRED LT CURR_DATE THEN 'Y' ELSE 'N'; NOPRINT


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
 
Posts: 55 | Registered: September 08, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Reply With QuoteReport This Post
Platinum Member
posted Hide Post
See if this helps.

DATE_CREATED is in a date format.

-SET &TODAY = &YYMD;
-SET &TDAY = AYMD (&TODAY, 0, 'I8YYMD');

COMPUTE DATE_CREATED1/I8YYMD = DATE_CREATED;
COMPUTE DATE_CHECK/A1 = IF &TDAY LT DATE_CREATED1 THEN 'Y' ELSE 'N';


WF 8 version 8.2.01M. Windows.
In focus since 1990.
 
Posts: 188 | Location: pgh pa | Registered: October 06, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Reply With QuoteReport This Post
Master
posted Hide Post
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';

-ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
Thank you Spence that works!


WebFOCUS 8.0.08
Solaris
HTML, PDF, XLS, CSV
 
Posts: 55 | Registered: September 08, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Compare Date in report to Current Date

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.