Tuesday, May 11, 2010

Checking For Blank Dates

In report expressions, advanced filters, etc. customers often want to check for blank dates an take an action. Only do this if the date is filled, for example. In ZP 32 part of the expression to check dates might look like this:
NOT EMPTY(insp_date)
That expression does not have the same results in ZP SQL because the databases handle dates differently. In SQL there never is a "blank" or empty date field. Rather it is set to "null" to show that it does not have a specific value yet. You can still get the same results in your expressions by  adding an extra function to convert nulls to blanks. The new expression would look like this:
NOT EMPTY(NVL(insp_date,""))
There are several other ways to do this as well but this approach works well when converting from ZP 32.

No comments:

Post a Comment