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.
Does anyone has codes to calculate number of weeks between two yyyymmdd dates ? week define as Monday to Sunday, if begin date is not Monday then 1st week is partial and all the other weeks are from Monday to Sunday until the last week equal to ending date and it can be partial too.
If you compute the two dates as a number since the beginning of the year and divide that number by 7 and as integer you have two weeknumbers. the difference is your result.
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
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
What do you want to see when startdate is in week 4 on friday and enddate is in week 5 on tuesday? Should this be 1 week since it's a different week, or 0 week because there are less then 7 days in between?
You could use the Date/Time function HDIFF "Find the Number of Units Between Two Date-Time Values" which allows for a Week component (it even allows you set the first day of the week using the WEEKFIRST parameter - SET WEEKFIRST = 7). You simply have to convert the Date columns to Date/Time columns using the Date/Time function HDTTM "Convert a Date Value to a Date-Time Value". Check out the WebFOCUS Functions manual.
DEFINE FILE CAR
DT1/YYMD = '20080910';
DT2/YYMD = '20081025';
-*-- Convert Date to Date/Time
DTTM1/HYYMDS = HDTTM(DT1, 8, 'HYYMDS');
DTTM2/HYYMDS = HDTTM(DT2, 8, 'HYYMDS');
DIFF1/D6 = HDIFF(DTTM2, DTTM1, 'WEEK', 'D6');
END
TABLE FILE CAR
PRINT
COUNTRY
DT1 DT2
DTTM1 DTTM2
DIFF1
WHERE READLIMIT EQ 1
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
Get for both Starting Date and Stopping Date 1) the number of times 7 is "included in" 2) the remainder of this division (YYMMDD is a number of Days since something around 31/12/1900, but you probably know better than I ..) The remainder of the division gives the Day in the week : Monday is 0 and Sunday 6. With this information Stachanov can solve your problem. Some One-Liners will give you more concise solutions. But it's the idea and Focus doesn't any longer need Masking Dates or INUMBEROFDAYS because the Date Format is great ( and Popular ?) Cordialement
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO
My Godness, I've turned Sylver member !!! Rather think of a growing old Don Quichotte, with a rusty armour. (and still with the head in the stars, notwithstanding the fact that his feet are in the mud ...) Focusely and Cordialy
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO
We use a T_DB2_ACCT_DATE table . It is universal and can be used in any server. In that table we have a field called WK_I ( week ID) , using this column we can easily calculate the no. of weeks between any two dates.
you can ask ur admin to set up this table for you. This comes in handy and is very useful.
I, also, had the opportunity to sing 'Time is on my side' along with Mick Jagger (Which Version Mick Jagger ?) But I know that my children or the children of my children will pass over your declining cleverness ... Focusely I thank you for the maintenance advice, I'll do that right now, along with bringing back my Minitel to the Post Office.
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO