Hello Nagarajan
Thanks for your response. we have tried your query and it works perfect.
What we have done is use the next query, and then using some code we are assignig the available quantity, this was in better performance.
SELECT LOTE.ItemCode Articulo ,LOTE.DistNumber Codigo_Lote,
- LOTE.AbsEntry Entry_Lote,LOTE.CreateDate Fecha_Creacion_Lote,
LOTE_CANTIDAD.WhsCode ALMACEN,LOTE_CANTIDAD.Quantity Stock,ISNULL(LOTE.MnfSerial,'') MnfSerial
FROM OBTN LOTE
JOIN OBTQ LOTE_CANTIDAD ON
(LOTE.AbsEntry =LOTE_CANTIDAD.MdAbsEntry AND LOTE.SysNumber=LOTE_CANTIDAD.SysNumber)
WHERE LOTE_CANTIDAD.ItemCode = 'ItemCode'
ORDERBY LOTE_CANTIDAD.WhsCode ASC
Thanks and regards
Jacobo