store procedure check expirydate
halo there, i need some help on writing store procedure.
i have 1 table which store the productid,productname,customerid expirydate of the product, remindersent.
customer table---> cusotmerid, customeremail
wat i wan to do is, i wan to check the expiry date for each customer 's products .
if the date diff between expirydate and today is 30days, then send a reminder to the customer and update the remindersent to 1. if the date diff expirydate and today is 14days, then send a reminder to the customer and update the remindersent to 2... how i write tis in store procedure?
plz guide me on how to write it. i know the basic for the store procedure, select, update, insert and delete only.thank you.hope can hear frm u all as soon.....coz urgent..plz help.
|