Add 1 day to original date and put in a different table
How do I add one day from Created_Date and pu开发者_开发知识库t into Due_Date field?
It is the smalldatetime data type if that makes a difference
Use the DateAdd() function.
UPDATE someTable SET Due_Date = DATEADD(day,1,Created_Date) WHERE ...
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().
精彩评论