Syntax error on IF statement in date formula. HELP

  • 0
  • 1
  • Question
  • Updated 11 months ago
  • Answered
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!
Photo of Ward Holberg

Ward Holberg

  • 120 Points 100 badge 2x thumb

Posted 11 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
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?
Photo of Ward Holberg

Ward Holberg

  • 120 Points 100 badge 2x thumb
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.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
So you are ok now?
Photo of Ward Holberg

Ward Holberg

  • 120 Points 100 badge 2x thumb
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))
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
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]
Photo of Ward Holberg

Ward Holberg

  • 120 Points 100 badge 2x thumb
That was the piece I was missing.  Thank you for your help.