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 do you default a paramenter date in a fex?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]How do you default a paramenter date in a fex?
 Login/Join
 
Platinum Member
posted
I have a fex that will retrieve all invoices created in a date range. It contains several amper variables. For simplicity, I will discuss only the date range. The MR HTML file allows the user to choose a begin and end create date range. I want to add another line in the fex that limits what ever they pick to a 6 month max range subtracting 6 months from the end date. In this case, the user entered a 12 year date range. I would like a way to add a where in the fex that says the begin date (&BDATE) is less than the end date (&EDATE) minus 6 months but keep the &BDATE since it could be a range of only 1 month. I see how to default a date based on the current date but our date ranges can vary. Does anyone have a solution for this?

TABLE FILE THAT1
PRINT
INVOICE
CREATE_DATE
WHERE CREATE_DATE GE '&BDATE'
AND CREATE_DATE LE '&EDATE';
-*add me WHERE CREATE_DATE LE '2011/10/01';
ON TABLE HOLD AS THAT2
END

For example, the user enters 2010/03/01 as &BDATE and 2012/03/31 as &EDATE. I want to add an additional line to the fex that says &BDATE is LE 2011/10/01 (6 months).

Thank you,
Geri

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




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
Gold member
posted Hide Post
The easiest way to do this would be something like the following:

WHERE CREATE_DATE LE DATEADD(&BDATE,'M',6);


WF: 8201, OS: Windows, Output: HTML, PDF, Excel
 
Posts: 78 | Registered: November 08, 2010Report This Post
Virtuoso
posted Hide Post
quote:
add a where in the fex that says the begin date (&BDATE) is less than the end date (&EDATE) minus 6 months


You can try the code below which will give a 6-month period-cap as needed in a way that will be "SQL-friendly", that is, your iWay adapter will be able to pass the filter for the database to handle.

-DEFAULT &BDATE = '2010/03/01';
-DEFAULT &EDATE = '2010/03/31';

-* Determine 1st day of the 6th month before end date
-SET &EDATE_YYM = EDIT(&EDATE, '9999$99');
-SET &MIN_BDATE = EDIT(AYM(&EDATE_YYM, -6, 'I6YYM'), '9999/99') || '/01';


TABLE FILE FOO
PRINT THIS AND THAT
WHERE FOO_DATE FROM '&BDATE' TO '&EDATE'
WHERE FOO_DATE GE '&MIN_BDATE'
END


That way, you will be limiting your date period to span no more than 6 months while still honouring smaller ranges if the user chooses so.

Hope this helps.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Platinum Member
posted Hide Post
njsden

Thank you, this worked perfect.




Prod: WebFOCUS 7.7.05 OS:Linux; Upgrading to: WebFOCUS 8.1.05 OS:Windows; Outputs: HTML, PDF, Excel; Adapters: SAP, MySQL, Oracle incl Report Caster
 
Posts: 102 | Location: Cincinnati, Oh USA area | Registered: November 02, 2006Report This Post
Virtuoso
posted Hide Post
You're welcome, Geri. I'm glad it worked!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 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     [SOLVED]How do you default a paramenter date in a fex?

Copyright © 1996-2020 Information Builders