How to Preserve Leading Zeros When Combining Microsoft Access Fields
Question details
The user needs to concatenate multiple numeric fields in Microsoft Access into a single string without losing the leading zeros from the original data.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Combining three separate four-digit numeric fields (for example: 3204, 1103, and 0001) into one continuous text value.
- Observed behavior
- Standard string concatenation removes the leading zeros from the numeric fields, transforming a value like '0001' into just '1' and resulting in an incorrect final string.
Identify the exact names of the fields you want to combine. It is highly recommended to generate this combined value dynamically within a query, form, or report rather than saving the duplicated calculation as a physical table field.
Use the Format Function to Concatenate Fields
Use the Access Format function to convert each numeric value into a fixed-length string of text before concatenating them.
By applying the Format function, you instruct Microsoft Access to enforce a specific number of digits (like four digits) for each segment. This ensures that any missing digits are filled with leading zeros before the fields are merged together.
Launch your Microsoft Access database. Go to the 'Create' tab on the ribbon and click on 'Query Design'.
Add the table containing your target numeric fields to the query design grid, then close the 'Show Table' dialog.
In an empty column within the 'Field' row at the bottom, type the following expression: CombinedValue: Format([Field1], "0000") & Format([Field2], "0000") & Format([Field3], "0000"). Be sure to replace Field1, Field2, and Field3 with your actual column names.
Click the 'Run' button (the red exclamation mark) in the ribbon to view your results. The output will correctly display the concatenated values with all leading zeros preserved.

Looking for a Free Alternative to Microsoft Office?
While WPS Office does not feature a dedicated database tool like Microsoft Access, it offers a highly capable Spreadsheet application that handles complex data formatting, concatenation, and management with a familiar interface. If you are looking for an intuitive, lightweight solution for your daily data processing, WPS Office is an excellent free alternative.
- 1. Download WPS Office: Visit the official WPS Office website to download the free installation package for your operating system.
- 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to set up the software.
- 3. Import and Format Data: Open WPS Spreadsheet, import your existing spreadsheets or databases, and use the TEXT() function to combine data while preserving zeros.

Frequently Asked Questions
Why does Microsoft Access remove leading zeros by default?
If a field is set to a 'Number' data type, Access treats it as a mathematical value. In mathematics, leading zeros hold no value (e.g., 0001 is equal to 1), so Access drops them to save space. To keep the zeros, the output must be formatted as text.
Can I change the table design to keep the leading zeros permanently?
Yes. If you change the field's Data Type from 'Number' to 'Short Text' in the Table Design view, Access will store exactly what you type, including any leading zeros. However, this may affect mathematical calculations if you need to compute sums or averages.
How do I preserve leading zeros when doing this in an Access Report?
In your Access Report's Design View, insert a Text Box. Open the Property Sheet, find the 'Control Source' property under the Data tab, and enter the formula: =Format([Field1], "0000") & Format([Field2], "0000") & Format([Field3], "0000").




