Beginning of week (BOW) & End of Week (EOW) in DATEMOV ??
In the DATEMOV function, you can have it return a Beginning of week (BOW) value or End of week (EOW) value, which are Monday and Friday respectively.
ex. DATEMOV('2005/05/04','BOW') returns a BOW value of May 2nd for the date of May 4th.
Also, if an event happened on a Saturday WF will create the BOW date as the following Monday.
ex. DATEMOV('2005/05/07','BOW') returns a BOW value of May 9th for the event date of May 7th which is a Saturday.
However, I need that Saturday event to return a BOW value of May 2nd.
In other words, I need to force a week of Sunday - Saturday instead of the WebFOCUS default Saturday - Friday.
Thanks in advance for the help. I am just getting started in WF and have already found this forum to be valuable.
July 02, 2005, 05:17 PM
jimster06
Welcome to WF. In regard to your query re setting business days, click on "Technical Documentation Library" at the top of this page and search for EOW. The system will return info on how to set up the week. HTH
July 04, 2005, 04:35 PM
reFOCUSing
I ran into this problem sometime ago, I got around this was by using the function DOWK and moved the date back x number of days.
I added the + 1 to get a monday date. I realized that it wont work for a sunday. The original code was for a sunday to saturday week which is
-SET &WKFR = DTYMD(&WKFI ,'I8YYMD');
M
July 06, 2005, 07:44 PM
Francis Mariani
Here's another idea:
Use function DOWK to determine the day of the week for your date:
-SET &DOW = DOWK (&TODAY_DT,'A10');
If &DOW is 'SAT' or 'SUN' subtract 2 from your date (using a date function to do that) and then determine the BOW AND EOW!!!
July 06, 2005, 09:21 PM
JPierce
Finally got it. For anyone who might need this later, Here is what I ended up with and it works. FYI, BOW is always a Monday, and EOW is always a Friday.
Thanks to everyone who gave advice.
SET DEFCENT = 20
DEFINE FILE SO STDT/MDYY = CLOSED_DT; day_dowk/I6YMD = CLOSED_DT; closed_dt_dow/A3=DOWK(day_dowk, 'A3'); STWK/MDYY = IF closed_dt_dow EQ 'SAT' THEN (STDT - 6) ELSE ( DATEMOV (STDT, 'BOW') -1 ); ENDWK/MDYY = IF closed_dt_dow EQ 'SAT' THEN STDT ELSE ( DATEMOV (STDT, 'EOW') + 1 );