Samer Al-Zain
Samer Al-Zain

Reputation: 21

update sql server datetime field

I already have data inserted in table with column of datetime named enddate. I want to update the all rows to have

 enddate = enddate - 1 minute.

How i can do this?

Thanks Samer

Upvotes: 1

Views: 243

Answers (1)

Glen Hughes
Glen Hughes

Reputation: 4832

UPDATE tableName
SET enddate = DATEADD(minute, -1, enddate)

detail DATEADD

Upvotes: 2

Related Questions