Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to decrement a value each second till zero

Author  Topic 

number23
Starting Member

5 Posts

Posted - 2009-01-26 : 05:10:46
I have a connection to mysql through ASP in which I insert value in a table :

insert into codes (expiry) values (400)

know i want this value to be decremented by one each second till it reaches 0 then drop it from the table.

i.e. if the value is 60, then i need it to be decremented by one each second, so after 60 second it reaches 0

please help me with this issue

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-26 : 05:30:13
Cross post http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=118560



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-26 : 08:29:52
whats the purpose of this record? can you explain that?
Go to Top of Page

number23
Starting Member

5 Posts

Posted - 2009-01-26 : 14:38:40
for user who access internet i will first look at the expiry value and give them access according to the time left.

so, once i insert the value in the table i want it to decrement with time till reach zero
Go to Top of Page

number23
Starting Member

5 Posts

Posted - 2009-01-26 : 14:38:48
for user who access internet i will first look at the expiry value and give them access according to the time left.

so, once i insert the value in the table i want it to decrement with time till reach zero
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-26 : 23:57:48
shouldnt you be doing this at front end by means of session state variables?
Go to Top of Page
   

- Advertisement -