Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys. I really need help for my Thesis project. I just wanted to ask how to alert or notify when a product has already been expired or 30 days to be expired.? Your help is highly appreciated

Dim strSql as string = "Select * from tblStocks where Expiry_Date <= Date()"

Thank you for the help.

What I have tried:

Dim strSql as string = "Select * from tblStocks where Expiry_Date <= Date()"

Thank you for the help.
Posted
Updated 22-Aug-22 4:59am
Comments
Richard MacCutchan 2-Dec-17 4:15am    
What is the problem?

Select * from tblStocks where Expiry_Date <= DATEADD(day,-30,GETDATE())
SQL

 
Share this answer
 
Dim Date1 As Date = Date.Today.ToString("yyyy-MM-dd")

    Dim adapter As New MySqlDataAdapter("SELECT Expiry_Date FROM productsdb where Expiry_Date <= '" & Date1.AddDays(30).ToString("yyyy-MM-dd") & "' ", conn)
VBScript

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900