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     [CLOSED] User inputted date plus 5 'WD' and to fetch respective date records

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] User inputted date plus 5 'WD' and to fetch respective date records
 Login/Join
 
Silver Member
posted
Hello,
I have a requirement where user would be selecting a date input and based on the date selected i have to add 5 working days to it and to show rows having one of the 5 dates computed in the output based on a date time column .
For ex: User is selecting 30th July as date input to run the report and there is a column A which is a date time field. Expected output should be 30th, 31st and 3rd, 4th and 5th Aug date rows matching on the column A.
I am actually looking for a sample data set to replicate this scenario and will post. Meanwhile any inputs appreciated. Thank you.

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 35 | Registered: July 17, 2020Report This Post
Virtuoso
posted Hide Post
Don't know all your spec, but here is a start

-DEFAULTH &I = 1
-DEFAULTH &INDT = 20200730
DEFINE FILE GGSALES
-* Below line is only used to convert &INDT field into a YYMD format and be able to use DATEADD function
DT     /YYMD = DATECVT(&INDT, 'I8YYMD', 'YYMD');
-REPEAT LOOPDT FOR &I FROM 1 TO 5
NDATE&I.EVAL /YYMD = DATEADD(DT, 'WD', &I);
-LOOPDT
END
TABLE FILE GGSALES
BY DATE NOPRINT
BY DT
BY NDATE1
BY NDATE2
BY NDATE3
BY NDATE4
BY NDATE5
WHERE RECORDLIMIT EQ 1;
END
-RUN


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
Thank you MartinY.
But my date input is selected in a calendar and it takes the following format which is July 01, 2020. How to change this to M/D/YYYY format.
 
Posts: 35 | Registered: July 17, 2020Report This Post
Virtuoso
posted Hide Post
The M/D/YYYY is a display format and not really an "input" format

-DEFAULTH &I = 1
-DEFAULTH &INDT = 20200730
DEFINE FILE GGSALES
-* Below line is only used to convert &INDT field into a YYMD format and be able to use DATEADD function
DT     /YYMD = DATECVT(&INDT, 'I8YYMD', 'YYMD');
-REPEAT LOOPDT FOR &I FROM 1 TO 5
NDATE&I.EVAL /YYMD = DATEADD(DT, 'WD', &I);
ODATE&I.EVAL /I8MDYY = NDATE&I.EVAL;
-LOOPDT
END
TABLE FILE GGSALES
BY DATE NOPRINT
BY DT
BY ODATE1
BY ODATE2
BY ODATE3
BY ODATE4
BY ODATE5
WHERE RECORDLIMIT EQ 1;
END
-RUN


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2410 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Silver Member
posted Hide Post
Thank you MartinY. In your code you have hard coded date and i replicated by passing a dynamic calendar date selected by user and i am not able to get right formatting. Can you please help? The code that i tried i'll post shortly.
 
Posts: 35 | Registered: July 17, 2020Report 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     [CLOSED] User inputted date plus 5 'WD' and to fetch respective date records

Copyright © 1996-2020 Information Builders