Guest User

Untitled

a guest
Nov 23rd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. select case when a.cdbnc =341 then 'ITAU'
  2. when a.cdbnc =224 then 'FIBRA'
  3. when a.cdbnc = 53 then 'MERCURY'
  4. when a.cdbnc = 95 then 'ITV'
  5. else 'ITV' END AS Localpg,
  6. a.nrdcmrct, c.DTEMDCRC, a.tpmvprdr, B.DTVCPDCR, a.cdbnc, a.cdagnbnc, a.dtmvpdcr, a.nrdcmrct, a.nrprdcrc, B.VRORPRDR,
  7. (a.VRMVMNC - a.VRJPDCRC - a.VRMPGDCR + a.VRDSODRC - a.VRCPDCRC) VRParcela,
  8. a.VRJPDCRC, a.VRMPGDCR, a.VRCPDCRC, a.VRDSODRC, a.VRMVMNC, b.VRCSPRDD,
  9. (a.VRMVMNC - b.VRCSPRDD - a.VRJPDCRC - a.VRMPGDCR + a.VRDSODRC) VRLucro,
  10. a.HRMVPRDC, B.vrprdrcr, (B.Vrprdrcr-b.vrorprdr)as VrCorrecao
  11. from tbmpr a, tbprc b, tbdor c
  12. where a.cdemp = :CDEMP
  13. and a.cdfllemp = :CDFLLEMP
  14. and a.dtmvpdcr >= :DTINI
  15. and a.dtmvpdcr <= :DTFIN
  16. and a.IDSTETPR is Null
  17. and b.cdemp = a.cdemp
  18. and b.cdfllemp = a.cdfllemp
  19. and b.nrdcmrct = a.nrdcmrct
  20. and b.nrprdcrc = a.nrprdcrc
  21. and c.cdemp = a.cdemp
  22. and c.cdfllemp = a.cdfllemp
  23. and c.nrdcmrct = a.nrdcmrct
  24.  
  25. order
  26. by a.tpmvprdr, a.cdbnc, a.nrdcmrct, a.nrprdcrc, A.DTMVPDCR, A.HRMVPRDC
Add Comment
Please, Sign In to add comment