Guest User

Untitled

a guest
Jun 23rd, 2016
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     SELECT MP.DTMOVPROD,TM.TIPOMOV,MP.CODNAT,MP.CODVENDA,MP.CODCOMPRA,MP.CODPROD,eq.descprod,eq.codfisc,MP.TIPOMOVPROD,MP.DOCMOVPROD,MP.CODALMOX,MP.CODLOTE,MP.QTDMOVPROD,MP.PRECOMOVPROD,MP.ESTOQMOVPROD,MP.SLDMOVPRODAX,EQ.TIPOPROD,MP.CUSTOMPMMOVPRODAX,MP.SLDMOVPROD,MP.CUSTOMPMMOVPROD,MP.CODMOVPROD,MP.CODEMPTM,TM.CODEMP,MP.CODFILIALTM,TM.CODFILIAL,(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,CLI.NOMECLI CODTIPOMOV FROM EQMOVPROD MP
  2.     INNER JOIN EQPRODUTO eq ON mp.codprod = eq.codprod
  3.     INNER JOIN vdvenda vd ON mp.codvenda=vd.codvenda
  4.     INNER JOIN vdcliente cli ON vd.codcli = cli.codcli
  5.     LEFT JOIN EQTIPOMOV TM ON TM.CODEMP = MP.CODEMPTM
  6.     WHERE MP.CODFILIALTM=TM.CODFILIAL AND MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' AND mp.codcompra IS NULL
  7.     UNION ALL
  8.     SELECT MP.DTMOVPROD,TM.TIPOMOV,MP.CODNAT,MP.CODVENDA,MP.CODCOMPRA,MP.CODPROD,eq.descprod,eq.codfisc,MP.TIPOMOVPROD,MP.DOCMOVPROD,MP.CODALMOX,MP.CODLOTE,MP.QTDMOVPROD,MP.PRECOMOVPROD,MP.ESTOQMOVPROD,MP.SLDMOVPRODAX,EQ.TIPOPROD,MP.CUSTOMPMMOVPRODAX,MP.SLDMOVPROD,MP.CUSTOMPMMOVPROD,MP.CODMOVPROD,MP.CODEMPTM,TM.CODEMP,MP.CODFILIALTM,TM.CODFILIAL,(MP.sldmovprod*MP.CUSTOMPMMOVPROD) SALDO,FORN.RAZFOR CODTIPOMOV FROM EQMOVPROD MP
  9.     INNER JOIN EQPRODUTO eq ON mp.codprod = eq.codprod
  10.     INNER JOIN cpcompra cp ON mp.codcompra = cp.codcompra
  11.     INNER JOIN cpforneced forn ON cp.codfor =forn.codfor
  12.     LEFT JOIN EQTIPOMOV TM ON MP.CODEMPTM=TM.CODEMP
  13.     WHERE MP.CODFILIALTM=TM.CODFILIAL AND MP.CODTIPOMOV=TM.CODTIPOMOV AND tipoprod='P' AND mp.codvenda IS NULL
RAW Paste Data