I need the return of a date, if it is "Null" in the DB, return another date or other than "Null."
I need the return of a date, if it is "Null" in the DB, return another date or other than "Null."
Assign the IS NOT NULL
as it will filter all non-NULL values.
SELECT * FROM Table WHERE DataInicio IS NOT NULL
Try this:
select case
when campo_que_pode_estar_null is null then 'valor retornado se estiver null'
else
campo_que_pode_estar_null
end
from tabela
With this, even if the field is null, it will return something.
I forgot to mention that the database was Firebird.
But I found a solution, I used coalesce('nomedacoluna',0 ou'') as 'nomedacoluna'