How can we update datetime value in a column using sql
say, if we want to update any of datetime values by adding an hour or 5 minutes etc.
UPDATE TableLastCalls
SET [NEXT_UPDATE_TIME] = ?? // want to add an hour
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You can use the
DATEADDfunction:This will add 1 hour. Use
DATEADD(minute, 5, [NEXT_UPDATE_TIME])instead to add 5 minutes.