December 28, 200916 yr 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.
December 28, 200916 yr 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
December 29, 200916 yr Author 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, 200916 yr by Guest
December 29, 200916 yr Author 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?
Create an account or sign in to comment