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.
I am working on some accounting reports that take as parameters YEAR and MONTH for the data selection. But some of the tables I am working with use date fiels so I need to create a couple of variable that can have a start and end date for the where statement. Could someone help me with a function that might work so I can create those dates using as parameters the YEAR and MONTH?
Example: YEAR:2009 MONTH:2 I need to have: STARTDATE=? (1/1/2009) ENDDATE=? (1/28/2009)
Thanks,
Rafael RangelThis message has been edited. Last edited by: Kerry,
Is the parameter for MONTH being passed as 2 or 02? If you can control the parameter list, its best to pass it as 02 then what field format is your date field in in your database, for the WHERE compare? -SET &MYDATE = &MYYEAR | &MYMONTH | '01'; The DATEMOV function will then give you the last day of that given month, as , ahem, 'Kofi' says ; There are a couple of other ways to do that, as well. But you have to know what your target format needs to be, to match your database field format.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
This is the technique I use -- it's the "old" way of coding but it works great. In the below code I'm passing in a year (&DPYEAR) and a month (&DPERIOD). I use the IMOD() function on the year to determine if the value passed in for year is a leap year or not. I then check the value passed in for month and set my &var &EOM to the correct value. I then concatenate the three fields together -- this snippet of code is wrapped into a loop in my fex -- you can just remove the .&ctr to use it not in a loop. Hope this helps.
-SET &REMAINDER = IMOD(&DPYEAR, 4, 'I3L');
-SET &EOM.&CTR = IF (&DPERIOD.&CTR EQ '02') AND (&REMAINDER EQ 0) THEN '29' ELSE
- IF (&DPERIOD.&CTR EQ '02') AND (&REMAINDER NE 0) THEN '28' ELSE
- IF (&DPERIOD.&CTR EQ '01' OR '03' OR '05' OR '07' OR '08' OR '10' OR '12') THEN '31' ELSE '30';
-SET &EDPYMD.&CTR = &DPYEAR | &DPERIOD.&CTR | &EOM.&CTR ;
WF 7.7.05 HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files HTML, Excel, PDF