I have a table QuestionAsked which contains a column DateofAsking. Now what i need is to extract each date value and check whether the difference between that day and the current day is 14 or not. If yes than i have to update a particular column in that table.I am running the following query.
declare @d int select @d=Datediff(dd,DateofAsking,getdate()) from QuestionAsked if(@d>=14) BEGIN update QuestionAsked set IsComplete='true' where Answer_id=1 END
Everytime I run this query only the records of first row gets updated. Rest all other rows are unaffected inspite of the fact that my tables first five rows contains the date whose difference with the current date is 14
Please help me out with this!!!
Thanks in Advance :)