If then else on Is Null

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • Answered
I have the following formula in a Formula Text field.  I know who to make this work in Visual Basic but having trouble in Quickbase.  Can someone assist in the correct layout?

If (not IsNull([Pend on Date Assigned to]) and IsNull ([Pend off Date Assigned to]) "Pending", If(not IsNull([Pend on Date Transferred to]) and IsNull ([Pend off Date Transferred to]) "Pending", If (not IsNull ([Pend On Date ReOpened By])and IsNull([Pend Off Date ReOpened by]), "Pending","Open")
Photo of cowannbell

cowannbell

  • 1,230 Points 1k badge 2x thumb

Posted 3 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 62,478 Points 50k badge 2x thumb
Note that you cannot use IsNull to test a text field and I do not know what field types there are you are testing.  But assuming they are not text fields

If(not IsNull([Pend on Date Assigned to]) and IsNull([Pend off Date Assigned to]) "Pending",

not IsNull([Pend on Date Transferred to]) and IsNull([Pend off Date Transferred to]) "Pending",

not IsNull([Pend On Date ReOpened By]) and IsNull([Pend Off Date ReOpened by]), "Pending",

"Open")


Photo of cowannbell

cowannbell

  • 1,230 Points 1k badge 2x thumb
Thanks.  I'm getting a syntax error.

Please check the syntax of your formula. Look for mismatched parentheses, missing quotes, or extra brackets.


If(not IsNull([Pend on Date Assigned to]) and IsNull([Pend off Date Assigned to])   "Pending",
not IsNull([Pend on Date Transferred to]) and IsNull([Pend off Date Transferred to]) "Pending",
not IsNull([Pend On Date ReOpened By]) and IsNull([Pend Off Date ReOpened by]), "Pending",
"Open")


More on syntax errors...
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,478 Points 50k badge 2x thumb
Sorry, I was missing commas

If(not IsNull([Pend on Date Assigned to]) and IsNull([Pend off Date Assigned to]), "Pending", 

not IsNull([Pend on Date Transferred to]) and IsNull([Pend off Date Transferred to]), "Pending", 

not IsNull([Pend On Date ReOpened By]) and IsNull([Pend Off Date ReOpened by]), "Pending",

"Open")

Photo of cowannbell

cowannbell

  • 1,230 Points 1k badge 2x thumb
Thanks so much.  That did it.