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.

會傳回代表數字之十六進位值的 String。

語法

十六進位 ( 數字 )

必要 數位引數 為任何有效的 數值運算式 或 字串運算式。

註解

如果 number 還不是整數,則會先四捨五入至最接近的整數,然後再進行評估。

如果 number

十六進位 傳回

Null

Null

空白

零 (0)

任何其他數位

最多八個十六進位字元


您可以在適當的範圍中直接以前置數位來表示十六進位數位, &H. 例如, &H10 在十六進位表示法中代表十進位 16。

查詢範例

Expression

結果​​

SELECT Hex (2) AS 運算式1 FROM ProductSales GROUP BY Hex (2) ;

傳回 「2」 的十六進位值,並在表達式1 欄中顯示結果。

SELECT quantity,Hex (quantity) AS HexValue FROM ProductSales;

傳回來自「數量」的值,以及「數量」欄中所有數據值的十六進位值,並在「HexValue」欄中顯示結果。

VBA 範例

附註: 下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。

此範例使用 十六進 位函數傳回數位的十六進位值。

Dim MyHex
MyHex = Hex(5) ' Returns 5.
MyHex = Hex(10) ' Returns A.
MyHex = Hex(459) ' Returns 1CB.

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!

×