Click here to Skip to main content
15,911,139 members
Home / Discussions / Database
   

Database

 
AnswerRe: Database question. very urgent Pin
alexisxavior24-Sep-06 19:36
alexisxavior24-Sep-06 19:36 
GeneralRe: Database question. very urgent Pin
riyasath24-Sep-06 20:39
riyasath24-Sep-06 20:39 
AnswerRe: Database question. very urgent Pin
Mike Dimmick25-Sep-06 0:19
Mike Dimmick25-Sep-06 0:19 
GeneralRe: Database question. very urgent Pin
riyasath25-Sep-06 16:41
riyasath25-Sep-06 16:41 
QuestionAutomating cross-table record(s) transferring Pin
iskaza24-Sep-06 10:18
iskaza24-Sep-06 10:18 
AnswerRe: Automating cross-table record(s) transferring Pin
Rob Graham24-Sep-06 11:15
Rob Graham24-Sep-06 11:15 
GeneralRe: Automating cross-table record(s) transferring Pin
iskaza24-Sep-06 11:47
iskaza24-Sep-06 11:47 
QuestionAutomating cross-table record(s) transferring(FollowUp) [modified] Pin
iskaza24-Sep-06 13:19
iskaza24-Sep-06 13:19 
Hey Rob,

I've scheduled a job in SQL Server Agent and created this step:

declare @ExpirationDate smalldatetime

select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False'

while (select datediff (day, @ExpirationDate, getdate())) <= 0

begin
   
update PostedJobs set Status = 'False'

end


The problem is that when I tested it it executes successfully but it doesn't update rows that I set their date couple of days later.

Execuse me, this is the first time I use most of these tools.

thanks




-- modified at 21:06 Sunday 24th September, 2006

Altered the code to:
declare @ExpirationDate smalldatetime

select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False'

while (select datediff (day, getdate(), @ExpirationDate)) <= 0

begin  

update PostedJobs set Status = 'False' where PostedJobs.ExpirationDate = @ExpirationDate
select @ExpirationDate = min( ExpirationDate ) from PostedJobs where Status <> 'False' 

end


worked fineLaugh | :laugh:
QuestionADO Recordsets in VC++ Pin
eusto24-Sep-06 5:09
eusto24-Sep-06 5:09 
AnswerRe: ADO Recordsets in VC++ Pin
vicky0000026-Sep-06 0:36
vicky0000026-Sep-06 0:36 
Questionfinding sql servers on a network Pin
steve_rm24-Sep-06 3:17
steve_rm24-Sep-06 3:17 
AnswerRe: finding sql servers on a network Pin
narendra.vendi26-Sep-06 1:46
narendra.vendi26-Sep-06 1:46 
QuestionRelationships vs. Joins Pin
iskaza23-Sep-06 14:55
iskaza23-Sep-06 14:55 
AnswerRe: Relationships vs. Joins Pin
ahmadHelmi23-Sep-06 19:40
ahmadHelmi23-Sep-06 19:40 
AnswerRe: Relationships vs. Joins Pin
Garry Shutler23-Sep-06 22:46
Garry Shutler23-Sep-06 22:46 
AnswerRe: Relationships vs. Joins Pin
Khawar Abbas124-Sep-06 19:35
Khawar Abbas124-Sep-06 19:35 
QuestionUsing ADO to access SQL Server with NT Authentication Pin
jmassa0123-Sep-06 12:32
jmassa0123-Sep-06 12:32 
AnswerRe: Using ADO to access SQL Server with NT Authentication Pin
Hesham Amin24-Sep-06 3:14
Hesham Amin24-Sep-06 3:14 
GeneralRe: Using ADO to access SQL Server with NT Authentication Pin
jmassa0124-Sep-06 13:28
jmassa0124-Sep-06 13:28 
GeneralRe: Using ADO to access SQL Server with NT Authentication Pin
Hesham Amin26-Sep-06 0:09
Hesham Amin26-Sep-06 0:09 
AnswerRe: Using ADO to access SQL Server with NT Authentication Pin
Mike Dimmick25-Sep-06 0:26
Mike Dimmick25-Sep-06 0:26 
QuestionError when trying connect to SQl Server 2000 Pin
Areff22-Sep-06 21:00
Areff22-Sep-06 21:00 
AnswerRe: Error when trying connect to SQl Server 2000 Pin
Rob Graham23-Sep-06 3:16
Rob Graham23-Sep-06 3:16 
QuestionDesperate urge to a proffesional answer Pin
iskaza22-Sep-06 17:55
iskaza22-Sep-06 17:55 
AnswerRe: Desperate urge to a proffesional answer Pin
Rob Graham23-Sep-06 3:50
Rob Graham23-Sep-06 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.