Suppose i have a table with columns: Approved, Joining_Date, Period.
Approve-String, Joining_Date-DateTime, Period-Integer.
Now I want to update the Approved column value to yes if the difference between today’s date and the Joining_Date column is greater than Period column. How can this be accomplished in a single query? Something like:
"UPDATE table_name SET Approved='Yes' WHERE (SYSDATE-Joining_Date>Period)"
I am using ASP.NET 4 and MS-SQL 2008 Express in VS 2010. Thanks in advance!!!
Assuming
Periodis in days: