Open In App

Replace() and Space() Function in MS Access

Last Updated : 31 Aug, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

1. Replace() Function :
In MS Access The Replace function will replace a substring by another substring with a specified number. In this function, the first parameter will be the string and the second parameter will be found (The substring to search for in string)  and the third parameter will be the replacement(The substring to replace find in the string) and fourth is optional is the starting point if not given then default it will be taken 1, fifth will be the count( number of replaces to perform), this will also optional.

Syntax :

Replace(string1, find, replacement, start, count) 

Example –

SELECT Replace("geeksforgeeks", "e", "i") AS ReplaceString;

Output –

ReplaceString
giiksforgiiks

Example –

SELECT Replace("geeksforgeeks", "g", "z", 4) AS ReplaceString;

Output –

ReplaceString
geeksforzeeks

2. Space() Function :
In MS Access, The Space function returns a string of the given number of space characters. A number will be pass as a parameter and it will return a string of the length of the given number and all characters will be space.

Syntax :

Space(number) 

Example –

SELECT len(Space(15)) AS SpaceString;

Output –

SpaceString
15

Example –

SELECT len(Space(10)) AS SpaceString;

Output –

SpaceString
10

Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads