Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
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
Go
New
Search
Notify
Tools
Reply
  
[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: 131 | Location: USA | Registered: August 21, 2008Reply With QuoteReport 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: 1788 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport 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: 131 | Location: USA | Registered: August 21, 2008Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Take a look at the link above for DATEMOV syntax.


WebFOCUS 8206, Unix, Windows
 
Posts: 1788 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport 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: 60 | Registered: November 15, 2005Reply With QuoteReport 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: 131 | Location: USA | Registered: August 21, 2008Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.