Skip to content
Loading
  • Satya Karki
    +1
    Hi, you can check by comparing the expiry date with the now date.
    1. SELECT * FROM PURCHASE_DETAILS WHERE EXPIRY< NOW() ORDER BY EXPIRY  
    +1
  • Sachin Singh
    +1
    To Know expiry before 15 days would be good and much better than Now.
    1. select * from PURCHASE_DETAILS PD where PD.EXPIRY = CONVERT(DATE, DATEADD(DAY, 15, GETDATE()));
    +1
  • Srinivasan Ramamoorthi
    +1
    I recommend changing the expiry column to datetime, then you can have queries that can return results with considering time too. Also converting from char to date might have performance issues.
    +1