By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,246 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,246 IT Pros & Developers. It's quick & easy.

Validating the date for one year

P: 4
Hi all !!!!
I am a new bee for programming, my question may be simple but i dont know how to do it...My senario is I have four column named DISCOUNT CODE, DATE ACTIVATED, DATE DEAVTIVATE, IS ACTIVE... So when i use the DISCOUNT CODE the DATE ACTIVATED should be todays date and the DATE DEACTIVATE should be exactly one year from the date activated...and in the IS ACTIVE column the value should be 1 untill the code is active....and after one year the value should be 0....

could some pls guide me how to write a stored procedure for this...Thanks in advance..

Regards,
Rahul
Sep 21 '07 #1
Share this Question
Share on Google+
3 Replies


pbmods
Expert 5K+
P: 5,821
Heya, Rahul.

So you want to change the IS ACTIVE column for each row where DATE DEACTIVATE < NOW()....
Sep 21 '07 #2

P: 4
yea the ISACTIVE should be 1 if it is < than DATE DEACTIVATE
Sep 22 '07 #3

pbmods
Expert 5K+
P: 5,821
Heya, Rahul.

Well, I'd say you've got all the info you need to run the query (and you can do this with a single UPDATE query).
Sep 22 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.