rlinsurf Posted December 28, 2009 Posted December 28, 2009 I just tried the following, posted elsewhere in the forums: Case[DayofWeek[OrderDate] < 5 , OrderDate + 9 , DayofWeek[OrderDate] = 5 or DayofWeek[OrderDate] = 6 , OrderDate + 11 , DayofWeek[OrderDate] = 7, OrderDate + 10,""] But this only works if there are only 7 days between. I actually need 12 business days starting from my order date.
jamesducker Posted December 28, 2009 Posted December 28, 2009 Are you trying to FIND the number of business days between two dates? Or are you trying to set a date that is X business days after a different date? The first can be done with a calculation field, the second needs a script. The solution I wrote takes account of business HOURS as well (eg if someone raises a support request after 5.30pm, the clock doesn't start ticking until after 9am). Yours James
comment Posted December 28, 2009 Posted December 28, 2009 See if this helps: http://fmforums.com/forum/showtopic.php?tid/162774/
rlinsurf Posted December 29, 2009 Author Posted December 29, 2009 (edited) Heh. In the meantime I did this, with the result as timestamp: Choose( DayOfWeek(GetRepetition ( Date ; 1 ) ); GetRepetition ( Date ; 1 )+ 60*60*24*16; GetRepetition ( Date ; 1 )+ 60*60*24*16; GetRepetition ( Date ; 1 )+ 60*60*24*16; GetRepetition ( Date ; 1 )+ 60*60*24*21; GetRepetition ( Date ; 1 )+ 60*60*24*21; GetRepetition ( Date ; 1 )+ 60*60*24*20; GetRepetition ( Date ; 1 )+ 60*60*24*14) But this seems to be working strangely. It looks like choose is 0-based... is that so? Edited December 29, 2009 by Guest
rlinsurf Posted December 29, 2009 Author Posted December 29, 2009 Looks like it is, and I had my numbers wrong. The following (I think) gives 12 business days from a given timestamp as timestamp: Choose( DayOfWeek(theTimestamp) ); ""; theTimestamp+ 60*60*24*16; theTimestamp+ 60*60*24*16; theTimestamp+ 60*60*24*16; theTimestamp+ 60*60*24*18; theTimestamp+ 60*60*24*18; theTimestamp+ 60*60*24*17; theTimestamp+ 60*60*24*16) Can someone check if this is correct?
Recommended Posts
This topic is 5514 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now