on 09-25-2012 10:39 PM
HOLA JOVENES, ALGUIEN PODRIA AYUDARME
TENGO ESTE QUERY PARA ORDENS DE FABRICACION, PERO SE TARDA MUCHO TIEMPO LA CONSULTA
QUIEN PODRIA AYUDARME PARA MEJORARLA, ESTA CONSULTA LA UTILIZO PARA ENVIAR A IMPRIMIR
LA ORDEN DE FABRICACION
MUCHAS GRACIAS DE ANTEMANO
select
t0.DocEntry as [idOrden],
t0.DocNum as [numeroOrden],
t0.DueDate as [fecha],
T0.Postdate as [fechaorden],
t0.ItemCode as [codigoP],
T0.COMMENTS AS [comentariosg],
(select u0.ItemName from oitm u0 where u0.ItemCode = t0.ItemCode) as [descripcionP],
(select u0.Name from [@PRESENTACION] u0 inner join oitm u1 on u1.u_presentacion = u0.code where u1.ItemCode = t0.ItemCode) as [presentacionP],
t0.PlannedQty as [planificado],
t0.CmpltQty as [producido],
t0.Uom as [unidad_medida],
t1.ItemCode as [codigoMP],
(select u0.u_codigoa from oitm u0 where u0.ItemCode = t1.ItemCode) as [codigoA],
(select u0.ItemName from oitm u0 where u0.ItemCode = t1.ItemCode and u0.ItmsGrpCod in (282, 283, 284, 285, 286, 287, 288)) as [descripcionMP],
t1.PlannedQty as [cantidadPlanificada],
(select u0.InvntryUom from oitm u0 where u0.ItemCode = t1.ItemCode) as [unidadMedida],
t1.wareHouse as [almacen],
t2.Comment as [comentario],
(select u0.U_peso from oitm u0 where u0.ItemCode = t1.ItemCode) as [PESO]
from
owor t0
inner join wor1 t1 on t1.DocEntry = t0.DocEntry
inner join itt1 t2 on t2.Father = t0.ItemCode and t2.Code = t1.ItemCode and t2.ChildNum = t1.Visorder
where
t1.ItemCode not in ('GF', 'GFL', 'GMO', 'GMOL', 'GD', 'GDL')
Agrega más filtros a tu clausula WHERE, como un rango de fechas
where
t1.ItemCode not in ('GF', 'GFL', 'GMO', 'GMOL', 'GD', 'GDL') AND T0.PostDate BETWEEN '[%0]' AND '[%1]'
Saludos
Felipe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
BUENOS DIAS FELIPE
GRACIAS POR CONTESTAR, FIJATE QUE ESTA CONSULTA PARA MANDAR
A IMPRIMIR LA ORDEN DE PRODUCCION, Y SI TIENE EL WHERE EL NUMERO
DE ORDEN DE PRODUCCION, PERO AUN ASI ESTA LENTA, EN LA
PARTE DE LISTA DE MATERIALES TIENE UN CAMPO QUE SE LLAMA COMENTARIOS
QUE SE TRAE PARA LA ORDEN, CREO QUE ESO ES LO QUE HACE QUE TARDE
LA CONSULTA,
HE TRATADO DE PONER EN LA ORDEN DE PRODUCCION EL CAMPO FORMETEADO
DE L CAMPO COMENTARIO QUE ESTA EN LA ORDEN DE PRODUCCION, PERO
NO HE PODIDO NO ME ACTUALIZA CUANDO SE GENERA LA ORDEN,
GRACIA DE ANTEMANO
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.