Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6585649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:41:23+00:00 2026-05-25T16:41:23+00:00

I have a table called node_status which has three columns: id (int) status (bit)

  • 0

I have a table called node_status which has three columns:

  1. id (int)
  2. status (bit)
  3. 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:41:24+00:00Added an answer on May 25, 2026 at 4:41 pm

    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:

    update 
         node_status 
    set 
         status = 0 
    where 
         modifiedtime < dateadd(minute, -5, getdate())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called ApprovalTasks... Approvals has a status column I also have
I have a table called BlogPost which has a 1-to-many relationship with the Comment
I have a table called ProjectRegion. It has two columns, an id and a
i have table called type which contains data family,individual i want in some pages
Assuming I have table called events with the columns INT id DATETIME start_time DATETIME
Have a table called person. which has personid and contactid. if a person is
I have a table called Node with 4 columns in which the data are
I have table called articles_tags which have two columns: article_id tag_id (has_and_belongs_to_many association) (I
I have table called emp . The table contains three columns empid , ename
i have a table called category in which i have main category ids and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.