Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

傳回指出指定月份的字串。

語法

MonthName ( month [, 縮寫 ] )

MonthName 函數語法具有下列自變數:

引數

描述

必要。 月份的數位指定。 例如,一月是 1,二月是 2,依此類型。

縮寫

選擇性。 指出 月份名稱是否要縮寫的布爾值。 如果省略,預設值為 False,這表示月份名稱不是縮寫。

查詢範例

Expression

結果​​

SELECT Monthname (“10”) AS Expr1 FROM ProductSales;

傳回代表「月份」之數位的月份「完整」名稱。 結果:「十月」。

SELECT Monthname (“10”,True) AS MonthTest FROM ProductSales;

傳回代表「月份」之數位的月份「縮寫」名稱,並顯示在「MonthTest」欄中。結果:「Oct」會傳回「ProductSales」數據表中「DateofSale」字段值的「月份」名稱,並顯示在「MonthTest」欄中。

選擇正確的日期函數

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×