回到日期中部分字符串函数DATENAME参数大全

   阅读
返回日期中部分字符串函数DATENAME参数大全

SQLServer

 

SELECT GETDATE()                        AS 当前日期,  
       DATENAME(YEAR, GETDATE())        AS 年,  
       DATENAME(MONTH, GETDATE())       AS 月,  
       DATENAME(DAY, GETDATE())         AS 日,  
       DATENAME(quarter, GETDATE())     AS 季度,  
       DATENAME(dayofyear, GETDATE())   AS 一年中的第多少天,  
       DATENAME(dw, GETDATE())          AS 星期,  
       DATENAME(week, GETDATE())        AS 周数,  
       DATENAME(hour, GETDATE())        AS 时,  
       DATENAME(minute, GETDATE())      AS 分,  
       DATENAME(second, GETDATE())      AS 秒,  
       DATENAME(millisecond,GETDATE())  AS 毫秒  

 



 转载地址:https://blog.csdn.net/yenange/article/details/12837277#

阅读