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] calculate monthend dates between two selected dates
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] calculate monthend dates between two selected dates
 Login/Join
 
Member
posted
Hi

I would like to know the easy way to calculate month end dates between two calendar dates without using loop.

example : if I select March 1, 2017 and July 4,2017

I need month end dates for March - July 2017.

This message has been edited. Last edited by: FP Mod Chuck,


8.0.2 , Windows
 
Posts: 2 | Registered: May 01, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Look up DATEMOV and EOM in the Doc.

https://webfocusinfocenter.inf...g/source/datemov.htm


WebFOCUS 8204, Unix, Windows
 
Posts: 1617 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Here's an example that might help ...

-* SET CURRENT DATE
-SET &CUR_YYMD  = &YYMD;
-*-SET &CUR_YYMD  = 20180120;
-*
-* SET MONTH DATES
-SET &BCM_YYMD  = DATECVT(DATEMOV(DATECVT(&CUR_YYMD, 'I8YYMD', 'YYMD'), 'BOM'),'YYMD', 'I8YYMD');
-SET &ECM_YYMD  = DATECVT(DATEMOV(DATECVT(&CUR_YYMD, 'I8YYMD', 'YYMD'), 'EOM'),'YYMD', 'I8YYMD');
-*
-TYPE ------------------------------------------------
-TYPE CURRENT DATE           (CUR_YYMD) ----- &CUR_YYMD
-TYPE ------------------------------------------------
-TYPE BEGIN CURRENT  MONTH   (BCM_YYMD) ----- &BCM_YYMD
-TYPE END   CURRENT  MONTH   (ECM_YYMD) ----- &ECM_YYMD
-TYPE ------------------------------------------------
-*
-* SET OTHER DATE FORMATS
-SET &CUR_DTE1 = EDIT(DATECVT(&CUR_YYMD,'I8YYMD','A8MDYY'),'99/99/9999');
-SET &CUR_DTE2 = DATETRAN(DATECVT(&CUR_YYMD, 'I8YYMD', 'MDYY'), '(MDYY)', '(trD)', 'EN', 20, 'A20') ;
-SET &CUR_MTH1 = DATETRAN(DATECVT(&CUR_YYMD, 'I8YYMD', 'MYY'), '(MYY)', '(tr)', 'EN', 20, 'A20') ;
-*
-TYPE --- OTHER CURRENT DATES
-TYPE ------------------------------------------------
-TYPE CUR_DTE1 ---- &CUR_DTE1
-TYPE CUR_DTE2 ---- &CUR_DTE2
-TYPE -------------
-TYPE CUR_MTH1 ---- &CUR_MTH1
-TYPE ------------------------------------------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 221 | Location: Lincoln Nebraska | Registered: August 12, 2008Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Try running the following code in your environment. Maybe this is what you are looking for.

-DEFAULT &StartDate = 'March 1, 2017';
-DEFAULT &EndinDate = 'July 4,2017';
 TABLE FILE syscolum
 PRINT NAME NOPRINT
 COMPUTE Inc/I11        = Inc + 1;
 COMPUTE StartYYMD/YYMD = '&StartDate';
 COMPUTE StartYYM/YYM   = StartYYMD;
 COMPUTE MonthYYM/YYM   = StartYYM + Inc - 1;
 COMPUTE MonthYYMD/YYMD = DTADD(StartYYMD, MONTH, Inc - 1);
 COMPUTE MonthEOM/YYMD  = DATEMOV(MonthYYMD, 'EOM');
 COMPUTE Endin/YYMD     = '&EndinDate';
 COMPUTE EndinYYM/YYM   = Endin;
 WHERE TOTAL MonthYYM - EndinYYM LE 0; 
 ON TABLE HOLD AS eom 
 END
 TABLE FILE eom
 SUM MonthEOM AS 'DTE'
 ACROSS Inc
 ON TABLE SET ASNAMES ON
 ON TABLE HOLD AS eomdates 
 END
-RUN
-READFILE eomdates
-? &DTE


WF 8.2.03
Win10 / IE11
AHTML EXL2K PDF COMT WP ZIP
 
Posts: 134 | Registered: October 19, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] calculate monthend dates between two selected dates

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.