[SOLVED]Date Issues: Need 1st day of the following month
Hi All
I have a procedure which has a column 'Next Invoice Date'. I want to set up a selection criteria where this 'Next Invoice Date' defaults to the first of the following month.
Please guide me how to achieve this.
Thank YouThis message has been edited. Last edited by: <Emily McAllister>,
Webfocus 8.1.05
February 21, 2017, 11:51 AM
BabakNYC
There are a lot of ways to get this date. Here's one:
-* This sets current date.
-SET &&CURDATE=&YYMD;
-* This sets first day of this month
-SET &&CMONTH=EDIT(&&CURDATE,'999999') || '01';
-* This sets what the current year-month is based upon todays's date
-SET &CMONTHYYM=EDIT(&&CURDATE,'999999');
-* This sets first day of next month
-SET &&NMONTH=EDIT(AYM(&CMONTHYYM, 1, 'I6YMD')) || '01';
-TYPE CURRENT DATE: &&CURDATE
-TYPE CURRENT YEAR MONTH: &CMONTHYYM
-TYPE FIRST DAY OF CURRENT MONTH: &&CMONTH
-TYPE FIRST DAY OF NEXT MONTH: &&NMONTH
WebFOCUS 8206, Unix, Windows
February 23, 2017, 11:43 AM
Nams
Thank You for your prompt reply.
The results is what I needed, however I'm unable to figure out how to change the format of the output.
The output is in the following format: CURRENT DATE: 20170223 CURRENT YEAR MONTH: 201702 FIRST DAY OF CURRENT MONTH: 20170201 FIRST DAY OF NEXT MONTH: 20170301
I want the FIRST DAY OF NEXT MONTH to be displayed as 03/01/2017 (MDYY format).
Can you please advise on how to change the date format.
Nams, did you read the manual? There's a wonderful section on Functions. Also, there are many examples on FocalPoint on how to use Date functions in Dialogue Manager. You should be able to find your answer using a few search techniques.
Regards,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 23, 2017, 02:15 PM
Francis Mariani
Here's one example on using Date functions in Dialogue Manager: