select * from movdiario A where A.emissao between ('2018-07-01') and ('2018-07-31') and A.tipo='V' and (A.situacao is null or A.situacao='' or A.situacao=' ') and A.itm_tab_exclusao=918 and A.CST_PIS in ('04')