Skip to Content
avatar image
Former Member

EXP Date Alert

Hello Experts

i am maintaining the batches in inventory for medicines now i want to generate an alert according to expiry date how should i design a query for doing such can u explain with example?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 08, 2010 at 12:19 PM

    You can try something like this:

    SELECT T0.[ItemCode],T0.[BatchNum],  T0.[WhsCode], T0.[Quantity], T0.[ExpDate],
      datediff(d,getdate(),T0.[ExpDate] ) 'remaining days'
    FROM OIBT T0
    WHERE datediff(d,getdate(),T0.[ExpDate] )<100 and T0.[Quantity]>0

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 08, 2010 at 11:25 AM

    where u did mention the expiry date

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 08, 2010 at 11:38 AM

    Hi,

    SELECT batchnum FROM OIBT T0 where ExpDate=getdate()

    Regards,

    Sachin

    Add comment
    10|10000 characters needed characters exceeded