I have a normal query:
select * from TABELAS
Where (AlvaraNumero <> '0')
and ( AlvaraValidade <> '0000-00-00' )
and ( AlvaraAnexo is NOT Null )
and ( AcidenteNumero <> '0')
and ( AcidenteValidade <> '0000-00-00' )
and ( AcidenteValidade <> '0000-00-00' )
and ( SeguroNumero <> '0')
and ( SeguroValidade <> '0000-00-00')
and ( FinancasValidade <> '0000-00-00')
and ( FinancasAnexo is NOT Null)
and ( SocialValidade <> '0000-00-00')
and ( SocialAnexo is NOT Null)
and ( RemuneracaoValidade <> '0000-00-00' )
and ( RemuneracaoAnexo is not Null)
and ( InstaladorNumero <> '0')
and ( InstaladorValidade <> '0000-00-00' )
and ( InstaladorAnexo is Not Null)
and ( MedicaValidade <> '0000-00-00')
and ( MedicaAnexo is Not Null)
order by tb_trabalhador.id asc
How to add to all fields that have End Validity because they are dates that can not be Null or have passed the date of today? If the date has already passed, it may no longer appear in this query.