Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @ANO INT
- DECLARE @MES INT
- DECLARE @VERBA INT
- declare @opt INT
- declare @NIVEL VARCHAR(10)
- DECLARE @OBS VARCHAR(300)
- SET @ANO = 2015
- SET @MES = 06
- SET @VERBA = 30259
- SET @OBS = '%%'
- set @opt = 1
- set @NIVEL = 'EIT'
- Select
- c.matricula,
- c.nome,
- c.nivel,
- c.plano,
- c.REPCARGO,
- lm.referencia,
- lm.verba,
- lm.valor,
- lv.periodoinicio,
- lv.periodofim,
- lv.obs
- from
- cadastro c
- join
- lancamentomes lm
- on c.matricula = lm.prontuario
- AND LM.ANO = @ANO
- AND LM.MES = @MES
- AND LM.VERBA = @VERBA
- JOIN LANCAMENTOMESVERBAS LV
- ON
- lm.prontuario = lv.prontuario and lm.verba = lv.verba and lm.ano = lv.ano and lm.mes = lv.mes
- and lv.obs like @obs
- where
- ( c.plano IN ('PMJ','PCJ') and c.nivel = @NIVEL )
- ORDER BY
- C.NOME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement