Forum Discussion

TaraTara's avatar
TaraTara
Qrew Member
11 years ago

How do I modify my existing formula date field to exclude weekends?

This is the formula I'm currently using...

[Date Entered] + Days(2)

It works great. However, right now if the date entered is a thursday or friday it returns a resulting date that falls on the weekend. How do I modify the formula to exclude the weekends?

Thanks in advance!

  • Tara,

    You would want to use the 'WeekdayAdd' formula function to solve this. See example:

    WeekdayAdd([Date Entered], Days(2))


    Hope that helps! Please feel free to reach out to me via my contact info on my profile if you need additional assistance.

    Thanks,

    Eric
  • I tried what you suggested and it gives me this error:

    "Formula error -- Bad or missing arguments in function call

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function WeekdayAdd.

    The function WeekdayAdd can be used with the following arguments:
    WeekdayAdd (Date d, Number n).
    WeekdayAdd (WorkDate d, Number n).

    You may need to do one of the following to fix the problem:
    Choose the right number and type of arguments.
    Use a type conversion function to convert the arguments you are using to the correct type.
    Choose a different function."
  • Scenario:  I'm trying to calculate a review due date based off the system date created field that doesn't fall on a weekend. I also would like to be able to edit the result as the due dates may need to be updated. 


    I'm trying to use the [Date Created] field in the WeekdayAdd function above and I'm getting the following error message.

    Formula error -- Bad or missing arguments in function call

    The types of the arguments or the number of arguments supplied do not meet the requirements of the function WeekdayAdd.

    The function WeekdayAdd can be used with the following arguments:
    • WeekdayAdd (Date d, Number n).
    • WeekdayAdd (WorkDate d, Number n).


    You may need to do one of the following to fix the problem:
    • Choose the right number and type of arguments.
    • Use a type conversion function to convert the arguments you are using to the correct type.
    • Choose a different function.

    What am I doing wrong?


    • KevinSlider's avatar
      KevinSlider
      Qrew Trainee
      you may have to convert date created to a date field, as it is a date/time field. 
      todate([date created])