on 09-07-2012 5:32 PM
BUENOS DIAS
alguien podria ayudarme en este query es para reporte de orden de compra, pero me esta haciendo lentro el proceso
como puedo agilizar , ya consume bastante recursos
de antemano gracias
select
t0.DocDate as [documentoFecha],
t0.DocDueDate as [documentoEntrega],
t0.DocEntry as [documentoCorrelativo],
t0.DocNum as [documentoNumero],
t0.Comments as [documentoObservacion],
(select u0.ExtraDays from octg u0 where u0.GroupNum = t2.GroupNum) as [documentoCondicion],
t0.DiscSum as [documentoDescuento],
t2.CardCode as [proveedorCodigo],
t2.CardName as [proveedorNombre],
t2.Address as [proveedorDireccion],
t2.Phone1 as [proveedorTelefono],
t2.VatIdUnCmp as [proveedorNIT],
t2.AddId as [proveedorNRC],
t2.U_tipocont as [proveedorContribuyente],
t2.CntctPrsn as [proveedorContacto],
coalesce((select u0.Substitute from oscn u0 where u0.ItemCode = t1.ItemCode and u0.CardCode = t2.CardCode), t1.ItemCode) as [articuloCodigo],
coalesce((select u1.Trans from omlt u0 inner join mlt1 u1 on u1.TranEntry = u0.TranEntry where u0.PK = t1.ItemCode and u0.TableName = 'OITM' and u1.LangCode = t2.LangCode), t1.Dscription) as [articuloNombre],
t1.Quantity as [articuloCantidad],
(select u0.BuyUnitMsr from oitm u0 where u0.ItemCode = t1.ItemCode) as [articuloUnidadMedida],
t1.PriceBefDi as [articuloPrecioADesc],
t1.DiscPrcnt as [articuloDescuento],
t1.Price as [articuloPrecioDDesc],
t1.PriceAfVAT as [articuloPrecioDImp],
t1.LineTotal as [articuloTotal],
t1.ItemCode as [articuloNUEVO],
t1.LineVat as [articuloTotalImpuesto]
from
opor t0
inner join por1 t1 on t1.DocEntry = t0.DocEntry
inner join ocrd t2 on t2.CardCode = t0.CardCode
Agrega filtros en la clausula "WHERE" como rango de fechas, o proveedores, etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Como te dije, debes agregarle filtros. Pero desde el crystal report.
Para más info consulta este documento:
http://addvisory.com/plsap/Dise%F1adorCR%208.8/Working_with_CR_Integration_881_esES.pdf
Saludos
Felipe
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.