Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. DECLARE @ANO INT
  2. DECLARE @MES INT
  3. DECLARE @VERBA INT
  4. declare @opt INT
  5. declare @NIVEL VARCHAR(10)
  6.  
  7. DECLARE @OBS VARCHAR(300)
  8.  
  9.  
  10. SET @ANO = 2015
  11. SET @MES = 06
  12. SET @VERBA = 30259
  13.  
  14. SET @OBS = '%%'
  15.  
  16. set @opt = 1
  17. set @NIVEL = 'EIT'
  18.  
  19. Select
  20. c.matricula,
  21. c.nome,
  22. c.nivel,
  23. c.plano,
  24. c.REPCARGO,
  25. lm.referencia,
  26. lm.verba,
  27. lm.valor,
  28. lv.periodoinicio,
  29. lv.periodofim,
  30. lv.obs
  31. from
  32. cadastro c
  33. join
  34. lancamentomes lm
  35. on c.matricula = lm.prontuario
  36. AND LM.ANO = @ANO
  37. AND LM.MES = @MES
  38. AND LM.VERBA = @VERBA
  39. JOIN LANCAMENTOMESVERBAS LV
  40. ON
  41. lm.prontuario = lv.prontuario and lm.verba = lv.verba and lm.ano = lv.ano and lm.mes = lv.mes
  42. and lv.obs like @obs
  43. where
  44. ( c.plano IN ('PMJ','PCJ') and c.nivel = @NIVEL )
  45. ORDER BY
  46. C.NOME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement