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     [SOLVED] How to Know the date when a week begins and ends

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to Know the date when a week begins and ends
 Login/Join
 
Member
posted
Hi,
I`d like to Know to get the date (yymmdd) that a week (1 to 53) begins and end.
For example: I have the week 19 and I need to Know that it begins the 20090504 and ends the 20090510.
Thank you very much.

Vicente, from Spain.

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6.1
Windows
HTML, Excel and PDF
 
Posts: 9 | Registered: May 05, 2009Report This Post
Expert
posted Hide Post
Vicente,

Before I answer your question I need some more details. Is your week number a data field or is it a Dialogue Manager variable? Does your week number contain the Year as well as the Week (200919) or is it just a Week (19)?


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
Expert
posted Hide Post
Here is some code that illustrates the necessary steps:

TABLE FILE CAR
PRINT
COUNTRY NOPRINT
-*-- Create a date-time field with today's date
COMPUTE EXDATETIME/HYYMDS   = HINPUT(14, '&YYMD.000000', 8, 'HYYMDS');
-*-- Set the week number to 19 (this can only be done with a date-time field)
COMPUTE INSERT_WEEK/HYYMDS  = HSETPT(EXDATETIME, 'WEEK', 19, 8, 'HYYMDS');
-*-- Create a date field from the date-time field
COMPUTE DATE1/YYMD          = HDATE(INSERT_WEEK, 'YYMD');
-*-- Subtract 1 day from the date field because setting the week also set the day to Saturday!
-*-- Saturday would force the beginning of the week to be the next Monday!
COMPUTE DATE2/YYMD          = DATEADD(DATE1, 'D', -1);
-*-- Determine the beginning of the week - Monday
COMPUTE DATE2_BOW/YYMD      = DATEMOV(DATE2, 'BOW');
-*-- Determine the end of the week - Sunday
COMPUTE DATE2_EOW1/YYMD     = DATEADD(DATE2_BOW, 'D', +6);
END


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
Thank you, That`s all I needed.

You`re a crack!!!

Vicente.


WebFOCUS 7.6.1
Windows
HTML, Excel and PDF
 
Posts: 9 | Registered: May 05, 2009Report 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     [SOLVED] How to Know the date when a week begins and ends

Copyright © 1996-2020 Information Builders