Home All Groups Group Topic Archive Search About

How to Compare Date every day automatically?

Author
3 Feb 2006 10:02 AM
savvy
I got various Job Details listed in my table. I have set all jobs in a
such a way that they will be LIVE when Flag=1 and EXPIRED when Flag=0.
But how can I compare the Expiry Job Date with the Current Date and
Update Flag=0 automatically when its expired. I probably need compare
everyday.
I have no clue how to do this. I looked at Triggers but may be its not
the one i'm looking for..
Is this possible in SQL Server?
Thanks in Advance for your time and help

Author
3 Feb 2006 10:15 AM
Dean
something like this:

update jobs
set flag=0
where expiry_date=convert(varchar(8),getdate(),112)

set up a job to run this update daily.

however, it seems redundant, to have both the expiry date and the flag in
the table.

dean

Show quote
"savvy" <johng***@gmail.com> wrote in message
news:1138960957.385296.309670@g47g2000cwa.googlegroups.com...
>I got various Job Details listed in my table. I have set all jobs in a
> such a way that they will be LIVE when Flag=1 and EXPIRED when Flag=0.
> But how can I compare the Expiry Job Date with the Current Date and
> Update Flag=0 automatically when its expired. I probably need compare
> everyday.
> I have no clue how to do this. I looked at Triggers but may be its not
> the one i'm looking for..
> Is this possible in SQL Server?
> Thanks in Advance for your time and help
>
Author
3 Feb 2006 12:16 PM
savvy
Thank you very much for your help Dean
I created a job in SQL Server and its working fine
Thanks in once again

AddThis Social Bookmark Button