MS Access Built-in Functions
MS Access offers a wide variety of built-in functions to manipulate data. This reference provides a summary of string, numeric, and date functions available.
MS Access String Functions
Function | Description |
---|---|
Asc |
Returns the ASCII value of a character. |
Chr |
Returns the character corresponding to an ASCII code. |
Concat (&) |
Joins two or more strings together. |
CurDir |
Returns the current directory path. |
Format |
Formats a value according to a specified format string. |
InStr |
Finds the starting position of one string within another. |
InStrRev |
Finds the starting position of one string within another, searching backward from the end. |
LCase |
Converts a string to lowercase. |
Left |
Extracts a specified number of characters from the left side of a string. |
Len |
Returns the length of a string. |
LTrim |
Removes leading spaces from a string. |
Mid |
Extracts a substring from a string, starting at a specified position. |
Replace |
Replaces occurrences of one substring with another. |
Right |
Extracts a specified number of characters from the right side of a string. |
RTrim |
Removes trailing spaces from a string. |
Space |
Creates a string containing a specified number of spaces. |
Split |
Splits a string into an array of substrings based on a delimiter. |
Str |
Converts a number to a string. |
StrComp |
Compares two strings. |
StrConv |
Converts a string between different casing styles (uppercase, lowercase, proper case). |
StrReverse |
Reverses a string. |
Trim |
Removes leading and trailing spaces from a string. |
UCase |
Converts a string to uppercase. |
MS Access Numeric Functions
Function | Description |
---|---|
Abs |
Returns the absolute value of a number. |
Atn |
Returns the arctangent of a number. |
Avg |
Calculates the average of a set of numbers. |
Cos |
Returns the cosine of an angle. |
Count |
Counts the number of records in a query. |
Exp |
Returns e raised to the power of a number. |
Fix |
Returns the integer part of a number. |
Format |
Formats a number according to a specified format string. |
Int |
Returns the integer part of a number. |
Max |
Returns the maximum value in a set of numbers. |
Min |
Returns the minimum value in a set of numbers. |
Randomize |
Initializes the random number generator. |
Rnd |
Returns a random number. |
Round |
Rounds a number to a specified number of decimal places. |
Sgn |
Returns the sign of a number (-1, 0, or 1). |
Sqr |
Returns the square root of a number. |
Sum |
Calculates the sum of a set of numbers. |
Val |
Converts a string to a number. |
MS Access Date Functions
Function | Description |
---|---|
Date |
Returns the current date. |
DateAdd |
Adds a specified interval to a date. |
DateDiff |
Calculates the difference between two dates. |
DatePart |
Extracts a specific part of a date (year, month, day, etc.). |
DateSerial |
Creates a date from year, month, and day values. |
DateValue |
Converts a string to a date. |
Day |
Returns the day of the month. |
Format |
Formats a date according to a specified format string. |
Hour |
Returns the hour part of a time. |
Minute |
Returns the minute part of a time. |
Month |
Returns the month of a date. |
MonthName |
Returns the name of the month. |
Now |
Returns the current date and time. |
Second |
Returns the seconds part of a time. |
Time |
Returns the current time. |
TimeSerial |
Creates a time from hour, minute, and second values. |
TimeValue |
Converts a string to a time. |
Weekday |
Returns the day of the week (number). |
WeekdayName |
Returns the name of the day of the week. |
Year |
Returns the year of a date. |
Other MS Access Functions
Function | Description |
---|---|
CurrentUser |
Returns the current user's name. |
Environ |
Gets the value of an environment variable. |
IsDate |
Checks if a value is a valid date. |
IsNull |
Checks if a value is NULL. |
IsNumeric |
Checks if a value is a number. |