[SOLVED] how to find First Monday and Last Monday of the Month
Hello
I have a routine that calculates business days in a week.. How would I find First Monday of the Month and Last Monday of the Month ? Is there a function available for this..
Would appreciate much if someone can share this ThanksThis message has been edited. Last edited by: FP Mod Chuck,
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
Thank you BabakNYC .. we have a launch page where user enters the mm yy Launch Page gives begin and end date 12/01/2019 - 12/31/2019
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7
February 05, 2020, 12:05 PM
BabakNYC
Take a look at the link above for DATEMOV syntax.
WebFOCUS 8206, Unix, Windows
February 05, 2020, 05:35 PM
Edward Wolfgram
You can try this:
-DEFAULTS &1 = &YYMD.EVAL
DEFINE FILE CAR
CURDAY/A8YYMD WITH COUNTRY = '&1';
AMON/A6YYM = EDIT(CURDAY,'999999') ;
IMON/YYM = AMON ;
INEXTMON/YYM = IMON + 1 ;
FIRSTDAY/YYMD = IMON;
FIRSTDOW/I2 = FIRSTDAY - ((INT(FIRSTDAY/7))*7) ;
FIRSTMON/YYMD = IF FIRSTDOW THEN (7-FIRSTDOW) + FIRSTDAY
ELSE FIRSTDAY ;
LASTDAY/YYMD = INEXTMON;
LASTNEW/I5 = LASTDAY ;
LASTDOW/I2 = LASTDAY - ((INT(LASTDAY/7))*7) ;
LASTMON/YYMD = IF LASTDOW THEN ((7-LASTDOW) + LASTDAY) - 7
ELSE LASTDAY - 7;
END
TABLE FILE CAR
PRINT CURDAY IMON FIRSTMON LASTMON
IF RECORDLIMIT EQ 1
END
-RUN
-EXIT
Prod/Dev/Test: WF 8.1.5 on (Windows Server 2012 R2 ) SandBox: WebFocus Server 8.1.5 on Windows Server 2008 R2 WebFOCUS App Studio 8.1.5 and Developer Studio 8.1.5 on Windows 7