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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
HPART Problems
 Login/Join
 
Platinum Member
posted
Hi Guys, I'm having some trouble calcualting dates using the hpart function. The following code seems to only generate zero's for the HPART functions. Any Ideas why?




WK_DATE/YYMD = &YYMD;
BASEDATE/YYMD=DATECVT(20040101,'I8YYMD', 'YYMD');

WK_MONTH/I2 = HPART(WK_DATE,'MONTH','I2');
WK_DAY/I2 = HPART(WK_DATE,'DAY','I2');
WK_YEAR/I4 = HPART(WK_DATE,'YEAR','I4');


SALES_WEEK/I5 = HPART(WK_DATE, 'WEEK', 'I5');
SALES_WK/I5 = (DATEDIF( BASEDATE, WK_DATE,'D') + 1) / 7 ;

Thanks, Lloyd

This message has been edited. Last edited by: <Mabel>,
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Silver Member
posted Hide Post
Loyd,

I think the problem is that the HPART is expecting a DATE-TIME value and you are only supplying a DATE value. I tried the following and was able to get the HPART function to work:

WK_DATE2/HYYMDIA = DT(&YYMD.EVAL 09:00AM);
WK_MONTH/I2 = HPART(WK_DATE2 ,'MONTH','I2');

Then I got the Month to show up in the report.

Jon
 
Posts: 39 | Registered: January 26, 2004Report This Post
Guru
posted Hide Post
Lloyd-
You are on the right track. The HPART function assumes that you are using an H form date/time variable. Put your WK_DATE and BASEDATE variables into H form such as HYYMDs and then work from there.
Take a look at how HCNVRT and HINPUT are used in the WF Function manual, p7-42, WF5.2.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders