You are on page 1of 1

--drop table #temporal

select Operacion = a.c000opecodigo,


Nombre_operacion = 'Consumo',
Numero_doc = a.C000OpeConsecutivo,
Fecha = a.C129EncFecha,
CC_origen = a.C000CodCentroCostosOrigen,
Nombre_cc_origen = '
',
CC_destino = a.C000CodCentroCostosDestino,
Nombre_cc_destino = '
',
Usuario = a.C129EncUsuario,
Nombre_usuario = '
',
Codigo_articulo = b.C000ArtCodigo,
Nombre_articulo = '
',
Cantidad = b.C129DetCantidad
into #temporal
from [dbo].[C129_EncMovimiento] a,
[dbo].[C129_DetMovimiento] b
where a.C129EncId = b.C129EncId
and b.C129DetId > 0
and b.C000ArtCodigo in
( '016007',
'016008',
'020804',
'020806',
'597799',
'030706',
'598433',
'001856',
'032873',
'051723',
'014928',
'597534',
'052253',
'599779',
'045551',
'598318',
'056157',
'013430'
)
and a.C129EncFecha between '2018-11-01' and '2018-12-31'
and a.C000OpeCodigo = '23'
and a.C000PlaCodigo = '01'

You might also like