Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Compare Date Formats HYYMD to YYMD

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Compare Date Formats HYYMD to YYMD
 Login/Join
 
Member
posted
I am trying to do a date comparision to see how many days have elapsed.
I have on date called FSTSTDT that is in format HYYMD
I have another date called CURRDATE that is in format YYMD

How do I convert FSTSTDT to YYMD so I can subtract the two dates from each other?

I already tried setting FSTSTDT to a new variable called
FDATE/YYMD = FSTSTDT
and this doesn't work.

Suggestions?
 
Posts: 18 | Registered: February 18, 2008Report This Post
Guru
posted Hide Post
In the upper right hand of this screen, you can click on Search the Technical Documentation Library. Search for HDATE.

There is also a very good book available about date handling.

HTH


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
Here's a quick example on how to convert a HYYMD date to YYMD using the HDATE function:

-SET &ECHO=ALL;

-SET &CURR_DATE = &YYMD;
-SET &CURR_TIME = EDIT(HHMMSS('A8'),'99$99$99');

-SET &CURR_DTTM = &CURR_DATE | &CURR_TIME;

DEFINE FILE CAR
CURR_DATE/HYYMD WITH MODEL = HINPUT(14, '&CURR_DTTM', 8, 'HYYMD');
END

TABLE FILE CAR
PRINT
CURR_DATE           

COMPUTE CURR_YYMD/YYMD = HDATE(CURR_DATE, 'YYMD'); 
WHERE RECORDLIMIT EQ 1
END
-RUN

(The DEFINE in this program simply creates a HYYMD date, since there is no real date field in the CAR file)
quote:
The HDATE function converts the date portion of a date-time value to the date format YYMD. You can then convert the result to other date formats.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
quote:
Francis



Env 1 Prod: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Env 1 Prod: WebFOCUS 5.3.2 Servlet - MRE/Dashboard/Self Service/ReportCaster - Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server
Env 2 Local: DevStudio 5.3.4 Servlet - Self Service - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel 2000 and PDF
Posts: 2588 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005

Ignored post by Francis Mariani posted February 20, 2008 02:41 PM Show Post

Previous Topic | Next Topic powered by eve community
Please Wait. Your request is being processed...
[x]

SiteFocal Point
Servleteve2da016
Version1.2.22 build 9062
ModuleForums 4.0.3
Stylesheet"ibi"
Wordlet Set"Default Wordlet Set"
Logout: Focal Point
Update Groupee Account Reply




Thank You Francis! The HDATE did what I was looking for. I suppose I could have used HDIFF as well. Correct?
 
Posts: 18 | Registered: February 18, 2008Report This Post
Member
posted Hide Post
Thank You Francis! The HDATE did what I wanted. I suppose I could have used the HDIFF as well. Correct?

Thanks again
 
Posts: 18 | Registered: February 18, 2008Report This Post
Expert
posted Hide Post
quote:
HDIFF Returns the number of units of a specific date-time component between two date-time values.

You would have to use HDTTM to convert CURRDATE to HYYMD before using HDIFF.

Something like:

DT2/HYYMD = HDTTM(CURRDATE, 8, 'HYYMDIA');
DIFF_DAYS/D8 = HDIFF(DT2, FSTSTDT, 'DAY', 'D8');


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Compare Date Formats HYYMD to YYMD

Copyright © 1996-2020 Information Builders