美文网首页
sql server 获取年季度数,年周数,年天数,本周天数

sql server 获取年季度数,年周数,年天数,本周天数

作者: 賣囡孩旳小火柴 | 来源:发表于2019-07-11 17:00 被阅读0次

    SELECT

    DATEPART(YEAR, GETDATE()) AS 年,

    DATEPART(MONTH, GETDATE()) AS 月,

    DATEPART(DAY, GETDATE()) AS 日,

    DATEPART(HOUR, GETDATE()) AS 时,

    DATEPART(MINUTE, GETDATE()) AS 分,

    DATEPART(SECOND, GETDATE()) AS 秒,

    DATEPART(MILLISECOND, GETDATE()) AS 毫秒,

    DATEPART(QUARTER, GETDATE()) AS 季度,

    DATEPART(DAYOFYEAR, GETDATE()) AS 年天数,

    DATEPART(WEEK, GETDATE()) AS 年周数,

    DATEPART(WEEKDAY, GETDATE()) AS 本周天数,

    DATENAME(YEAR, GETDATE()) AS 年,

    DATENAME(MONTH, GETDATE()) AS 月,

    DATENAME(DAY, GETDATE()) AS 日,

    DATENAME(HOUR, GETDATE()) AS 时,

    DATENAME(MINUTE, GETDATE()) AS 分,

    DATENAME(SECOND, GETDATE()) AS 秒,

    DATENAME(MILLISECOND, GETDATE()) AS 毫秒,

    DATENAME(QUARTER, GETDATE()) AS 季度,

    DATENAME(DAYOFYEAR, GETDATE()) AS 年天数,

    DATENAME(WEEK, GETDATE()) AS 年周数,

    DATENAME(WEEKDAY, GETDATE()) AS 本周数

    相关文章

      网友评论

          本文标题:sql server 获取年季度数,年周数,年天数,本周天数

          本文链接:https://www.haomeiwen.com/subject/tuidkctx.html