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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to get a timed action in SQL2000..

Author  Topic 

Rarz
Starting Member

1 Post

Posted - 2002-10-24 : 08:24:37
I'm not even sure if this is possible, but I would like to know how to make an action that runs every 24hrs on SQL server, putting a date in a field, if another date reaches the 'two weeks ago'-mark.

Is this possible?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-10-24 : 08:29:34
Yes, you can create a SQL job and set up a schedule for it to run at pretty much any interval you choose. Books Online has details under "jobs", also look here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=20146

You can use the DateDiff() function to determine a two-week difference between today's date (getdate()) and the dates in your table. Again, Books Online has more detail and examples of DateDiff() and DateAdd().

Go to Top of Page
   

- Advertisement -