You are here:
LPAD
Inserts characters you specify to the left-side of a text string.
Use
LPAD(text, padded_length[,
pad_string]) and replace the variables:
- text is the field or expression you want to insert characters to the left of.
- padded_length is the number of total characters in the text that’s returned.
- pad_string is the character or characters that are inserted. pad_string is optional and defaults to a blank space.
If the value in text is longer than pad_string, text is truncated to the size of padded_length.
Tips
Leading blank spaces and zeros are omitted.
LPAD(Name, 20) truncates the Name field after 20
characters. For example, if the name is mycompany.com, the
value returned is "mycompany.com."
LPAD('my_company.com', 14, 'z') returns
“my_company.com” without change because it has 14 characters.
LPAD(Name, 15, 'z') returns the name
“zmycompany.com.”
LPAD(Name, 2) truncates the name after the second
character. For example, if the name is mycompany.com, the
value returned is “my.”

