I have the following question. In SQL your doing so works.
...and coalesce(tb_cadastro.cod_produto,'') = coalesce(:COD_PRODUTO, coalesce(tb_cadastro.cod_produto,'')) and ...
Where COD_PRODUTO
is an integer, what would I do if the field is of type DATE
? I've tried it that way, but I can not filter for a date.
...and coalesce(cast(tb_cadastro.dt_pallet AS varchar(10)),'') = coalesce(:DT_PALLET, coalesce(cast(tb_cadastro.dt_pallet AS varchar(10)),''))