The createtime field in the usertable in the database is added for ten days.
Use Database
Update [usertable] Set createtime = dateadd (day, 10, createtime)
Dateadd Introduction
Returns the newDatetimeValue.
Syntax
Dateadd( Datepart, Number, Date)
Parameters
Datepart
Is a parameter that specifies which part of the date should be returned to the new value. The following table lists the dates and abbreviations recognized by Microsoft SQL Server.
Date |
Abbreviations |
Year |
YY, yyyy |
Quarter |
QQ, Q |
Month |
Mm, m |
Dayofyear |
Dy, y |
Day |
DD, d |
Week |
Wk, WW |
Hour |
HH |
Minute |
Mi, n |
Second |
SS, S |
Millisecond |
MS |
Number
Is used to addDatepart. If you specify a value that is not an integer, the fractional part of the value is discarded. For exampleDatepartSpecifyDay, IsNumberSpecify1.75, ThenDateIt will increase by 1.
Date
YesDatetimeOrSmalldatetimeValue or date format string expression.
If you only specify the last two digits of the year, the number of the last two digits smaller than or equal to the value of the "two-digit year deadline" configuration option is in the same century as the end year. The last two-digit number greater than the value of this option is in the century before the end of the century. For example, ifTwo digit year cutoffIs 2049 (default), then 49 is interpreted as 2049,2050 is interpreted as 1950. To avoid blurring, use a four-digit year.
Return type
datetime, is returned. However, if the date parameter is smalldatetime, smalldatetime is returned.