![]() ![]() If only a time value is assigned to a date data type variable, DATEDIFF sets the value of the missing date part to the default value. If startdate and enddate are both assigned only a time value, and the datepart is not a time datepart, DATEDIFF returns 0.ĭATEDIFF uses the time zone offset component of startdate or enddate to calculate the return value.īecause smalldatetime is accurate only to the minute, seconds and milliseconds are always set to 0 in the return value when startdate or enddate have a smalldatetime value. For second, the maximum difference is 68 years, 19 days, 3 hours, 14 minutes and 7 seconds. ![]() For millisecond, the maximum difference between startdate and enddate is 24 days, 20 hours, 31 minutes and 23.647 seconds. ![]() This case means that if we start at startdate '', and then count -2 days, we reach the enddate of ''.įor a return value out of range for int (-2,147,483,648 to +2,147,483,647), DATEDIFF returns an error. The int difference between the startdate and enddate, expressed in the boundary set by datepart.įor example, SELECT DATEDIFF(day, '', '') returns -2, hinting that 2036 must be a leap year. See Configure the two digit year cutoff Server Configuration Option for information about two-digit year values. Each specific datepart name and abbreviations for that datepart name will return the same value.Īn expression that can resolve to one of the following values: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |