FROM [AlphaInd 5].[dbo].[Comandas] A, [AlphaInd 5].[dbo].[NFSaida] v
WHERE a.data between cast('2022-01-01' as date) and cast('2022-07-31' as date) 
and v.Numero = a.NotaFiscal
and v.Loja = a.NotaFiscal_Loja
and v.Serie = a.NotaFiscal_Serie
and a.NotaFiscal_Serie = 1