lisa
lisa

Reputation: 91

Add 1 day to original date and put in a different table

How do I add one day from Created_Date and put into Due_Date field?

It is the smalldatetime data type if that makes a difference

Upvotes: 1

Views: 67

Answers (2)

Chains
Chains

Reputation: 13157

Actually, with respect to DAY, you can just add/subtract directly. I.e. (borrowing from @David):

UPDATE someTable SET Due_Date = Due_Date + 1 WHERE ...

It's just a short-cut for DATEADD().

Upvotes: 0

David
David

Reputation: 73554

Use the DateAdd() function.

UPDATE someTable SET Due_Date = DATEADD(day,1,Created_Date) WHERE ...

Upvotes: 3

Related Questions