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] capture the month from user's input

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] capture the month from user's input
 Login/Join
 
Gold member
posted
Hello,

I want to capture the month from the users input.
We are not using a HTML launch page for this.
For e.g. if the user inputs the date as 03/01/2010, then I need to capture the month 03 in a variable.
Can you please suggest a method of capturing it?
The sample code is below:

TABLE FILE ORD
PRINT
ORD.DEAL_NUMBER AS 'Contact, #'
WHERE ( ORD.VALUE_DATE GE DT(&FROM_VALUE_DATE.Please enter the From Date.) ) AND ( ORD.VALUE_DATE LE DT(&TO_VALUE_DATE.Please enter the To Date.) );
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
ENDSTYLE
END

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


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
 
Posts: 82 | Registered: February 23, 2011Report This Post
Member
posted Hide Post
Hope that your users will always enter the date in the same format: 99/99/9999, otherwise you'll have to play with many function :-)

So considering that the format is kept the same, the month will always be the first two digits and easily be captured using the following:

-SET &MONTH = EDIT(&FROM_VALUE_DATE, '99');

Otherwise here some logic that can be applied to insure to have the month in two digits format :

-SET &DATELEN = ARGLEN(10, &FROM_VALUE_DATE, 'I3');
-SET &SLASHPOS = POSIT(&FROM_VALUE_DATE, &DATELEN, '/', 1, 'I3');
-SET &OUTLEN = &SLASHPOS - 1;
-SET &MTH = SUBSTR(&DATELEN, &FROM_VALUE_DATE, 1, &OUTLEN, &OUTLEN, 'A2');
-SET &MTHLEN = ARGLEN(2, &MTH, 'I2');
-SET &MTHFIX = IF &MTHLEN LT 2 THEN '0' || EDIT(&MTH, '9') ELSE &MTH;

TYPE &MTHFIX


WF 7.6.11 HF4 gen34, WF 7.7.03 gen 253,
Windows 64 bit
Excel, PDF, HTML
 
Posts: 18 | Registered: December 06, 2007Report This Post
Gold member
posted Hide Post
Thanks a lot Martin for providing the logic. Worked well for me.


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
 
Posts: 82 | Registered: February 23, 2011Report 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] capture the month from user's input

Copyright © 1996-2020 Information Builders