Jump to content

This topic is 5514 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted (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 by Guest
Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.