Discussions

 View Only
  • 1.  How do I modify my existing formula date field to exclude weekends?

    Posted 05-30-2014 18:15

    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!



  • 2.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 05-30-2014 18:48
    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


  • 3.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 05-30-2014 18:54
    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."


  • 4.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 05-30-2014 19:25
    WeekdayAdd([Date Entered], 2)


  • 5.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 05-30-2014 19:56
    That worked perfectly! Thanks so much for your help!


  • 6.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 09-12-2018 00:45
    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?




  • 7.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 09-12-2018 00:57
    you may have to convert date created to a date field, as it is a date/time field. 
    todate([date created])


  • 8.  RE: How do I modify my existing formula date field to exclude weekends?

    Posted 09-12-2018 22:02
    That worked perfectly! Thank you!