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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] how to find First Monday and Last Monday of the Month

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] how to find First Monday and Last Monday of the Month
 Login/Join
 
Platinum Member
posted
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
Thanks

This 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
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Virtuoso
posted Hide Post
What's the format of your date field?

https://infocenter.information...rce%2Fdatetime11.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report This Post
Virtuoso
posted Hide Post
Take a look at the link above for DATEMOV syntax.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Gold member
posted Hide Post
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



>>ex test 202002

 PAGE     1
 
 
 CURDAY      IMON     FIRSTMON    LASTMON                                      
 ------      ----     --------    -------                                      
 2020/01/00  2020/02  2020/02/03  2020/02/24


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
Platinum Member
posted Hide Post
Thanks Edward Wolfgram


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
 
Posts: 134 | Location: USA | Registered: August 21, 2008Report 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 to find First Monday and Last Monday of the Month

Copyright © 1996-2020 Information Builders