I have a table called node_status which has three columns:
id (int)status (bit)modifiedtime (smalldatetime)
I want to run a query on it such that if any row in the table contains a modifiedtime value which is more than 5 minutes before the current time then the status column set to 0 (false).
Can any body tell me how to do this? (using SQL Server)
Thanks
When you want to do a query based on the current time you can use getdate(), and use the dateadd function to add or remove amounts of time from a date. As such: