If Function Bad Argument Error

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have the following:

var date start = [CDS Start]; var date finish = [CDS Finish]; var text owner = [Study Analyst];

$start & "<br>" & If(not IsNull($finish),$finish,"Unscheduled") & "<br>" & $owner

Why is the If statement giving me a bad argument call? I've used this function many times and it looks perfectly fine to me.

Photo of Ben

Ben

  • 40 Points

Posted 3 years ago

  • 0
  • 1
If(not IsNull($finish),$finish,"Unscheduled")


This problem is in the above IF. You are saying that the IF will resolve to a date or a text string. You can't mix like that.

You teally
want

If(not IsNull($finish),ToText($finish),"Unscheduled") & "<br>" & $owner