GFG App
Open App Browser
Continue

# Hex() and Oct() Function Function in MS Access

1. Hex() Function : Hex() Function in MS Access is used to returns a String representing the hexadecimal value of a number. Syntax :

`Hex(number)`

Parameter : This method accepts one parameter as mentioned above and described below :

• number : It is any valid numeric expression or string expression.

Returns : If the number is null it returns null, if the number is Empty then it returns Zero (0). Otherwise it returns a String representing the hexadecimal value of a number. Note : If number is not already a whole number, it is rounded to the nearest whole number before being evaluated. Example-1 : Hexadecimal representation of 2.

`SELECT Hex(2) AS HexNumber;`

Output :

Example-2 : Hexadecimal representation of 13.

`SELECT Hex(13) AS HexNumber;`

Output :

Example-3 : Hexadecimal representation of 1134.80.

`SELECT Hex(1134.80) AS HexNumber;        `

Output :

2. Oct() Function : Oct() Function in MS Access is used to returns a String representing the octal value of a number. Syntax :

`Oct(number)`

Parameter : This method accepts one parameter as mentioned above and described below :

• number : It is any valid numeric expression or string expression.

Returns : If the number is null it returns null, if the number is Empty then it returns Zero (0).Otherwise it returns a String representing the octal value of a number. Note : If number is not already a whole number, it is rounded to the nearest whole number before being evaluated. Example-1 : Octal representation of 7.

`SELECT Oct(7) AS OctNumber;                `

Output :

Example-2 : Octal representation of 111.45.

`SELECT Oct(111.45) AS OctNumber;                `

Output :

My Personal Notes arrow_drop_up
{"ft_lang_label":"__label__en","ft_lang_prob":0.57007635,"math_prob":0.9718892,"size":1736,"snap":"2023-14-2023-23","text_gpt3_token_len":408,"char_repetition_ratio":0.14318706,"word_repetition_ratio":0.6210526,"special_character_ratio":0.25230414,"punctuation_ratio":0.16913946,"nsfw_num_words":1,"has_unicode_error":false,"math_prob_llama3":0.9916439,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-10T23:48:25Z\",\"WARC-Record-ID\":\"<urn:uuid:52471690-d28e-4637-a4b2-82926c63d272>\",\"Content-Length\":\"235321\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b0d09a33-10fb-4f76-b009-ca70b4cdcf64>\",\"WARC-Concurrent-To\":\"<urn:uuid:d72c443a-6c63-43fa-9056-1230251d286b>\",\"WARC-IP-Address\":\"44.228.100.190\",\"WARC-Target-URI\":\"https://origin.geeksforgeeks.org/hex-and-oct-function-function-in-ms-access/?ref=lbp\",\"WARC-Payload-Digest\":\"sha1:BMUWNNYSN4LPK6L5IMGTKBT3KKKGH24Q\",\"WARC-Block-Digest\":\"sha1:EEKRK6UDLHRUMCTMRM276N5PIYAFSSKZ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224646652.16_warc_CC-MAIN-20230610233020-20230611023020-00716.warc.gz\"}"}