Discussions

Expand all | Collapse all

Syntax error on IF statement in date formula. HELP

  • 1.  Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 16:38
    I am trying to use a date formula to calculate a date if a checkbox is unchecked or allow a user to enter a date if a checkbox is checked.

    IF([Verification Extension] = 1, Date(yyyy, mm, dd), [Actual Date for Corrective action Implemented]+Days(14))

    I continue to get a syntax error on the above formula? HELP!


  • 2.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 17:52
    Try this

    IF([Verification Extension] = true, [Actual Date for Corrective action Implemented]+Days(14))

    But what result do you want if the [Verification Extension] is not true?


  • 3.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 18:39
    If [Verification Extension] is true, I want the user to input the date manually. If it is not true, I want it to calculate the date as you described above.


  • 4.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 18:57
    So you are ok now?


  • 5.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 19:10
    No.  I can not enter the date manually.  It will only calculate.  Here is what I have now and continue to get a syntax error. 

    If([Verification Extension] = false, [Actual Date for Corrective action Implemented]+Days(14),Date(yyyy,mm,dd))

    It works fine if the ([Verification Extension] checkbox is unchecked, but does not allow me to enter a date manually if I only use the formula:

    If([Verification Extension] = false, [Actual Date for Corrective action Implemented]+Days(14))


  • 6.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 19:28
    You cannot enter data into a formula field.

    So, if you want data entry you will need to create a new field and then have a formula determine how to use that field.

    Perhaps what you want is this

    If([Verification Extension] = false, [Actual Date for Corrective action Implemented]+Days(14),
    [My manual data entry field])

    Then you would have a form rule to which says

    When [Verification Extension] is not checked:

    Show [My manual data entry field]
    Require [My manual data entry field]


  • 7.  RE: Syntax error on IF statement in date formula. HELP

    Posted 12-11-2017 23:19
    That was the piece I was missing.  Thank you for your help.