put this into a stored procedure and schedule that sproc to run at the desired time with job schedulerdeclare @startTommorow datetime, @endTommorow datetimeselect @startTommorow = DATEADD(d, DATEDIFF(d, 0, GetDate()), 0)+1, @endTommorow = @startTommorow +1select relevantColumnsfrom YourMedicineTablewhere ExpirationDate >= @startTommorow and ExpirationDate < @endTommorow
Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp