有没有人知道sqlserver中类似于next_day的用法。

kanghl 2001-12-25 09:15:52
...全文
204 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mashansj 2001-12-25
  • 打赏
  • 举报
回复
DATEADD (T-SQL)
Returns a new datetime value based on adding an interval to the specified date.

Syntax
DATEADD(datepart, number, date)

Arguments
datepart
Is the parameter that specifies on which part of the date to return a new value. The table lists the dateparts and abbreviations recognized by Microsoft® SQL Server™.


Datepart 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 the value used to increment datepart.
date
Is an expression that returns a datetime or smalldatetime value, or a character string in a date format. For information about specifying dates, see datetime and smalldatetime.
If you specify only the last two digits of the year, values that are less than or equal to the last two digits of the value of the two digit year cutoff configuration option are in the same century as the cutoff year. Values that are greater than the last two digits of the value of this option are in the century that precedes the cutoff year. For example, if two digit year cutoff is 2049 (default), 49 is interpreted as 2049 and 2050 is interpreted as 1950. To avoid ambiguity, use four-digit years.

Return Types
Returns datetime, but smalldatetime if the date argument is smalldatetime.
kanghl 2001-12-25
  • 打赏
  • 举报
回复
能查出某一天之后的第一个星期几是哪一天吗?
zhuzhichao 2001-12-25
  • 打赏
  • 举报
回复
DATEADD

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧