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.
| Author |
Topic |
|
hamid.y
Starting Member
22 Posts |
Posted - 2010-03-01 : 08:54:03
|
| i want to check a date and if 2 hours remaning to that date just prompt user.can you help me. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-01 : 08:56:15
|
quote: Originally posted by hamid.y i want to check a date and if 2 hours remaning to that date just prompt user.can you help me.
Post some sample data with expected resultMadhivananFailing to plan is Planning to fail |
 |
|
|
hamid.y
Starting Member
22 Posts |
Posted - 2010-03-01 : 09:00:59
|
| for example this is the date :2010-03-07 17:18:41.473i want if the time is 2010-03-07 15:18:41.473sql prompt me an alarm.how can i check continuously with NOW time? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-01 : 09:08:17
|
| where datecol>=dateadd(hour,2,getdate())MadhivananFailing to plan is Planning to fail |
 |
|
|
hamid.y
Starting Member
22 Posts |
Posted - 2010-03-01 : 09:11:12
|
| you are right.but it works when you wanna run it yourself explicitly.but i wanna check it automatically .i mean whenever the time diff of current time and my datecol have been 2 hours sql automatically prompt me and no need to execute it.thanks again |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-03-01 : 09:13:34
|
quote: Originally posted by hamid.y you are right.but it works when you wanna run it yourself explicitly.but i wanna check it automatically .i mean whenever the time diff of current time and my datecol have been 2 hours sql automatically prompt me and no need to execute it.thanks again
SQL Server can't prompt you. It is the job of a front endWhat you can do is set up a job that runs periodicallyMadhivananFailing to plan is Planning to fail |
 |
|
|
hamid.y
Starting Member
22 Posts |
Posted - 2010-03-01 : 09:14:40
|
| thanks dear |
 |
|
|
|
|
|