Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scheduled triggers ?

Status
Not open for further replies.

sandeepmur

Programmer
Dec 14, 2003
295
PT
Hi,

I have a table populated with items which have a state -> valid or invalid. Once a item is checked as invalid it should stay as invalid for a period of 3 days upon which the state should automatically turn to valid.

Is there any way of achieving this without manual intervention?? hope the above was clear.

thnx,
sg
 
I can't imagine any way achieving that. You would always have to keep a record of when the item was set to Invalid. A few alternatives might be:

(1) Replace the boolean field with a Date field called DateInvalidated, and base your queries on whether DateInvalidated is more than 3 days old.

(2) Add a Date field called DateInvalidated, and run a daily procedure to reset the item to Valid if DateInvalidated is more then 3 days old.

(3) When setting the item to Invalid, set it to a value of 3, and run a daily procedure to decrement the value (to a minimum of 0). Your queries would then be based on whether the item's value was 0 (Valid) or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top