How to check if a Date Element is Null

By | December 6, 2007

Testing if a Date Element is null within a Formula Element is simple, right? It is not as obvious as you may think.

If you attempt to do this by comparing the date to a numeric value of zero you receive the following error when validating the formula “Mixed datatypes used as operands. (17000,1768) The operand(s) on either side of an operator must be of the same datatype.”.

Likewise, the same error occurs if you compare a Date element to an empty Character.

The simple (but no so obvious) solution is to compare the Date Element to another date element that you know is currently Null.