Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
520 B
0
Indexable
Never
SELECT
     invnfe2.nfekey
    ,mb2.ordno AS Pedido
    ,inv2.storeno AS LojaEntrada
    ,inv2.nfname AS NFe
    ,ords.auxShort1 AS LojaDestino
    ,ords.amt AS Valor
    ,inv2.grossamt as ValorNota
FROM sqldados.inv2
LEFT JOIN sqldados.invnfe2 ON inv2.invno = invnfe2.invno
INNER JOIN sqldados.mblistinv mb1 ON mb1.invno = inv2.invno
INNER JOIN sqldados.mblistord mb2 ON mb1.groupno = mb2.groupno
INNER JOIN sqldados.ords ON inv2.storeno = ords.storeno AND mb2.ordno = ords.no
WHERE invnfe2.nfekey = :key ;
Leave a Comment