Focal Point
[SOLVED]Date Issues: Need 1st day of the following month

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6487006586

February 21, 2017, 11:34 AM
Nams
[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 You

This 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.

Thank You


Webfocus 8.1.05
February 23, 2017, 12:17 PM
WF1326
Try this

-SET &FRMTDATE = EDIT(&&NMONTH, '$$$$99$$') || '/' || EDIT(&&NMONTH, '$$$$$$99') || '/' || EDIT(&&NMONTH, '9999$$$$');


WebFOCUS
7703/7705/8105m/8201m/8202m

February 23, 2017, 02:13 PM
Francis Mariani
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:

http://forums.informationbuild...451007171#2451007171


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
March 01, 2017, 11:45 AM
Nams
Thank you WF1326 and Francis!

I was able to get the date in MDYY format using the code as suggested by WF1326.

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


Webfocus 8.1.05