473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Validating the date for one year

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
3 1097
pbmods
5,821 Expert 4TB
Heya, Rahul.

So you want to change the IS ACTIVE column for each row where DATE DEACTIVATE < NOW()....
Sep 21 '07 #2
yea the ISACTIVE should be 1 if it is < than DATE DEACTIVATE
Sep 22 '07 #3
pbmods
5,821 Expert 4TB
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

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

Similar topics

13
by: David Gray | last post by:
Greetings all, Quick newbie type question: I would like to be able to trap non-numerical data entered into a textbox via CTRL+C and/or Shift+Insert. I realise that this data can be...
5
by: Astra | last post by:
Hi All I have a <SELECT> for the month (1 .. 12) and a <SELECT> for the year (2004 .... 2020), do you know of any js validation check I can use to check whether these values are older than...
1
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets...
11
by: tshad | last post by:
I have 4 dropdown boxes (fromDay, fromMonth, ToDay and ToMonth) I want to be able to test to make sure that the dates are valid and the the From dates are < the To dates. When I add the...
2
by: owz | last post by:
Ok, I am making a program (java class file) 2 work out if a date entered is valid or invalid for the day, month year, and for leap years.. dd/mm/yyyy . I seem 2 have gotten it 2 validate the year...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
2
by: SONIQ | last post by:
Using javascripts to validate this form. Basic operation, when a user clicks the submit order button, the javascript code must validate everything entered by the user. Please help finnish this...
8
by: Rob Wilkerson | last post by:
Surprisingly (at least to me), there doesn't seem to be a built-in function to validate a date value (like, say, is_date()). Given that, is there a best practice for determining whether a value is...
6
by: Richard | last post by:
I'm validating a date and time string which must be EXACTLY of the format yy-mm-dd hh:mm:ss and extracting the six numeric values using sscanf. I'm using the format string "%2u-%2u-%2u...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.