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     How to extract both month and day

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to extract both month and day
 Login/Join
 
Gold member
posted
Hi Guys,

I have a date field. Let's name it order_date.
The format is YYMD. I would like to know how to extract both the month and the day from order_date...

I have read the documentation but didnt find a solution in extracting only both month and day.

Any suggestions?


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Platinum Member
posted Hide Post
For example:

TABLE FILE CAR
  PRINT
    COMPUTE ORDER_DATE/YYMD = &YYMD ;
    COMPUTE MONTH/M = ORDER_DATE ;
    COMPUTE DAY/D = ORDER_DATE ;
    COUNTRY NOPRINT
END

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Gold member
posted Hide Post
Ok, I see so there isnt one function to it in one shot.
so all i need now is to concatenate them!
works for me

Thank you


PROD: WebFOCUS 7.1.0 on Linux/Tomcat 5.5.12 (standalone)/Informix on AIX
TEST: WebFOCUS 7.1.3 on Linux/Tomcat 5.5.16 (standalone)/Informix on AIX
 
Posts: 53 | Location: Montreal,Quebec,Canada | Registered: February 13, 2006Report This Post
Platinum Member
posted Hide Post
Working with dates, there are multiples ways, and there are many date functions, but in this case, aren't specially necessary.

If you want month and day concatenated... Another example:

TABLE FILE CAR
  PRINT
    COMPUTE ORDER_DATE/YYMD = &YYMD ;
    COMPUTE ODA8/A8YYMD = ORDER_DATE ;
    COMPUTE ODMD/A4 = EDIT(ODA8, '$$$$9999') ;
    COUNTRY NOPRINT
END

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Virtuoso
posted Hide Post
and if you need a '/'

COMPUTE ODM/A2 = EDIT(ODA8, '$$$$99$$') ;
COMPUTE ODD/A2 = EDIT(ODA8, '$$$$$$99') ;
COMPUTE MD/A5 = ODM |'/'| ODD;


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
Come on Prarie, don't forget -

COMPUTE ODA8/A8YYMD = ORDER_DATE ;
    COMPUTE ODMD/A5 = EDIT(ODA8, '$$$$99/99') ;
Winky

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Member
posted Hide Post
I have recently come across this problem of extracting the day and month separetely from the date field. We have a function available to do this. It works fine.

HNAME(DATE, 'MONTH', MON)

HNAME is the function
DATE is the original field which contains the
date
MONTH is the field you want to extract
MON is the temporary field which I have created to stroe the extracted month value

To do this Go to Define option, click on new button...Give the name for your temporary field...Select the function button..Under category select date & time..HNAME is the function....& so on...

Please let me know if it does not work..


Regards,
Ashok Kumar M
 
Posts: 11 | Registered: April 18, 2006Report This Post
Virtuoso
posted Hide Post
Yes Tony...that's better..brain was not working..that late in the day. Eeker


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 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     How to extract both month and day

Copyright © 1996-2020 Information Builders