Skip to Content
author's profile photo Former Member
Former Member

query de los articulos proximos a caducar por su fecha de vencimiento

Hola buen día quisiera solicitar apoyo para ver un query que me pueda dar los artículos próximos a caducar por su fecha de vencimiento

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 05, 2014 at 06:16 PM

    Hola Felix,

    Prueba con esto :

    SELECT

    T2.ItemCode as 'Articulo', T0.ItemName, T2.BatchNum,T2.Indate 'Entrada',t2.ExpDate,T2.Quantity

    FROM

    OITM T0 INNER JOIN OIBT T2 ON T0.ItemCode = T2.ItemCode

    WHERE

    t2.ExpDate < '[%0]' and t2.ExpDate !='' and t2.Quantity > 0

    Order by t2.ExpDate DESC

    Saludos

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2014 at 01:54 PM

    Hola Buen día realice la búsqueda con el siguiente query espero y les sea de utilidad

    SELECT T0.[ItemCode] '# Artículo',T0.[ItemName] 'Nombre de Artículo', T0.[BatchNum] 'Lote', T0.[WhsCode] 'Almacén', T0.[Quantity] 'Cantidad',

    T0.[ExpDate] 'Fecha de caducidad', datediff(d,getdate(),T0.[ExpDate] ) 'Días Vencidos ➖ y proximos a vencer ➕'

    FROM OIBT T0

    WHERE datediff(d,getdate(),T0.[ExpDate] )<100 and T0.[Quantity]>0


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.