10 Replies Latest reply on Jan 27, 2013 12:23 PM by christinesephton

# calendar

Is there a way to set a date field to only use the dates of monday - friday (work week) of every month and ignore sat and sundays?

• ###### 1. Re: calendar

Your question is not clear. A date field can store any valid date. Do you want to validate the field against entering a weekend date, or auto-correct any such entry, or... ?

• ###### 2. Re: calendar

Yes. What I would like it to do is when a order date is entered the due date is calculated to always be 5 working days after the start date. Since we do not work on sat or sun how would you get the formula to work.

• ###### 3. Re: calendar

robby@brays.net wrote:

What I would like it to do is when a order date is entered the due date is calculated to always be 5 working days after the start date.

Assuming StartDate is always a work day, try =

StartDate + 7

• ###### 4. Re: calendar

Hey Thanks!  I think that will work !

• ###### 5. Re: calendar

To be safe I would use the following Calculation:

Let(sd=dayofweek(start date+7);

Case(sd=1;start date+8;sd<7;start date+7;start date+9))

That will always return a work day, just in case someone works or enters something on a weekend.

Thanks,

Christine

• ###### 6. Re: calendar

Thanks for the help. I think that will work. Now, if that gives me the due date I am looking for, how could I then make a delivery date calc that would take the due date (the one you just made the calc for) and push it ahead to the closest Tues or Thurs , since those are my dedicated delivery dates.

Thanks for all the help

• ###### 7. Re: calendar

Try =

Let ( [

dW = DayOfweek ( DueDate )

] ;

DueDate - dW + Case ( dW ≤ 3 ; 3 ; dW ≤ 5 ; 5 ; 10 )

)

• ###### 8. Re: calendar

Let ( dd = DayofWeek ( DueDate ) ;

DueDate + Case ( dd ≤ 3 ; 3 ; dd ≤ 5 ; 5 ; 10 ))

• ###### 9. Re: calendar

Christine Sephton wrote:

Let ( dd = DayofWeek ( DueDate ) ;

DueDate + Case ( dd ≤ 3 ; 3 ; dd ≤ 5 ; 5 ; 10 ))

That doesn't look right.

• ###### 10. Re: calendar

Let ( dd = DayofWeek ( DueDate ) ;

DueDate-dd + Case ( dd ≤ 3 ; 1 ; dd ≤ 5 ; 5 ; 10 ))

Which is pretty much what you had.  I omitted the -dd

Christine