Karen,
 
Yu can probably use the following workaround;
SET VAR vDate DATE = .#DATE -- or whatever date you want
SET VAR vPWD = (IFEQ(TDWK(.vDate),'Monday',(.vDate -3),(.vDate-1)))
 
The function TDWK return the “Day” of the week as text.
Now, if your date is on a Monday, it will return the previous Friday, otherwise 
it will return the previous day. Just like the DFNW it does not consider 
holidays, although you can create stored function with lookup table that does 
that for you.
You can also use the function :
IDWK(arg)
Which will return the day of the week as an INTEGER and then instead of 
“Monday” you compare it to 1.
Probably other ways to do it but the ones above seem to be pretty straight 
forward.
 
Javier,
 
Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137
 
From: [email protected] [mailto:[email protected]] On Behalf Of Karen Tellef
Sent: Wednesday, May 06, 2015 10:49 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Previous business day function?
 
I'm happily using the DNW(.vdate) function with a loop to go out business days. 
 But now I also need a function that goes backwards to a PREVIOUS business day. 
 I don't see a function for that, right?  So I have to do the day of the week 
thing?

Karen

Reply via email to