Forum Discussion

WardHolberg's avatar
WardHolberg
Qrew Trainee
8 years ago

Syntax error on IF statement in date formula. HELP

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!
  • 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?
  • 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.
  • 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))
  • 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]