iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-22-2008, 07:22 AM
WebProWorld New Member
 
Join Date: Nov 2007
Posts: 12
kumiko RepRank 0
Unhappy 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.
Reply With Quote
  #2 (permalink)  
Old 03-22-2008, 03:56 PM
WebProWorld New Member
 
Join Date: Jun 2006
Location: NorthEast
Posts: 24
studiokraft RepRank 0
Default Re: store procedure check expirydate

Hello,

What is the DB you are using, and what language have you programmed the front-end in?

If you are using PHP/MySQL you may want to check out:

DATE_SUB() in MySQL:
MySQL :: MySQL 5.0 Reference Manual :: 11.6 Date and Time Functions

strtotime() in PHP:
PHP: strtotime - Manual
__________________
~==================================~
Kim Kraft
StudioKraft
http://www.studiokraft.com/
~==================================~
Reply With Quote
  #3 (permalink)  
Old 03-23-2008, 02:19 AM
WebProWorld New Member
 
Join Date: Nov 2007
Posts: 12
kumiko RepRank 0
Default Re: store procedure check expirydate

hi there, i m using MS SQL Server 2005 + ASP language
Reply With Quote
  #4 (permalink)  
Old 04-21-2008, 08:23 PM
WebProWorld Member
 
Join Date: May 2006
Posts: 33
Chiefos RepRank 1
Default Re: store procedure check expirydate

Im pretty sure that you can't send emails with SPRocs, I could be wrong but it doesn't sound like this would be the place to write this sort of logic. Seems that the best thing to do is to retrieve all customer information as one DB call and then process the email send out in your ASP code.

Depending on how many customer records you will have to update and the regularity of this type of action then its your call whether you batch these update statements together and run send them all over the wire to the db or not.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I remove the Dreamweaver Check In/Check Out Feature?? WebMasterKrames Graphics & Design Discussion Forum 2 03-28-2007 12:22 PM
Linking procedure RHunt Search Engine Optimization Forum 4 10-09-2006 10:47 PM
Google Search Spares Preemie From Risky Procedure jmiller Google Discussion Forum 0 09-12-2005 05:23 PM
Buying a domain privately - what's the procedure? Matt N Domain Discussion Forum 2 07-26-2005 03:59 AM
Pricester Store Vs EBay Store prevaly eCommerce Discussion Forum 2 10-06-2004 09:16 PM


All times are GMT -4. The time now is 01:17 AM.



Search Engine Optimization by vBSEO 3.3.0