Postgres Check If Date Is Null Mysql Compiler