Others

How to Add a Decimal Based on Another Field in Microsoft Access

Tauseeq MagsiTauseeq Magsi Nov 3, 2026 871 views

Question details

The user needs to convert imported text values into numbers and dynamically insert a decimal point based on the value found in another field.

How to Add a Decimal Based on Another Field in Microsoft Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Formatting imported data where numeric strings and their corresponding decimal-position indicators are stored in separate fields.
Observed behavior
The data currently exists as a plain text string and a separate decimal position number, and needs to be combined into a properly formatted numeric decimal field.
Before you start

Ensure you have a recent backup of your Access database before running any update queries, as they will permanently modify the data in your tables.

Solution 1Recommended

Use an Update Query with a Power of Ten Formula

Create a new numeric field and populate it using an update query that divides the text field by 10 raised to the power of the decimal-position field.

When importing data where numbers and decimal placements are stored separately, you can mathematically construct the correct decimal by using the expression: FirstField / (10 ^ SecondField).

For example, a text value of 1705 with a decimal position value of 2 will be processed as 1705 / 100, which successfully returns 17.05.

1
Create a target numeric field

Open your table in Design View and add a new column to store the final result. Set the Data Type to 'Number' and the Field Size to 'Double' or 'Decimal' to ensure it can hold decimal values.

2
Set up the query design

Navigate to the 'Create' tab on the ribbon and click 'Query Design'. Select the table containing your imported data to add it to the query workspace.

3
Switch to an Update Query

In the Query Setup group on the ribbon, click 'Update' to change the query type from a Select Query to an Update Query.

4
Apply the conversion formula

Drag your newly created numeric field into the query grid. In the 'Update To' row, enter the formula: CDbl([YourTextField]) / (10 ^ [DecimalPositionField]). Ensure you replace the field names with your actual column names.

5
Run the query

Click the 'Run' button (red exclamation mark) in the Results group to execute the query. Confirm the prompt to update the rows and check your table to see the correctly formatted decimals.

Use an Update Query with a Power of Ten Formula
Text Conversion: The CDbl function is necessary to convert your original text value into a double-precision number before the mathematical division is performed.
Free Microsoft Office alternative

Need a Free Office Suite? Try WPS Office

While Microsoft Access is a paid database application, you can handle most data manipulation, text-to-number conversions, and reporting for free using WPS Spreadsheet. It is a lightweight, highly compatible alternative to Microsoft Office.

Fully compatible with Microsoft Excel (.xlsx), Word (.docx), and PowerPoint (.pptx) formats.Easily handle complex formulas, data formatting, and text-to-number conversions without database queries.Free, lightweight, and fast to install on Windows, Mac, and Linux.Familiar user interface makes migrating from Microsoft Office completely seamless.
QA img-9

Frequently Asked Questions

Can I use the CDbl function in an Access Select Query without altering my table?

Yes, you can use the CDbl function and the division formula directly in a standard Select Query. This will calculate and display the converted numbers dynamically without permanently updating or modifying your source table.

What happens if the text field contains non-numeric characters?

If the text field contains letters or special symbols, the CDbl function will fail to evaluate it as a number and will return an error (such as #Error) during query execution. Ensure your data is cleaned of non-numeric characters before running the query.

How do I add a fixed number of decimal places to all records instead of using a second field?

If every record requires the exact same decimal placement (for example, two decimal places), you do not need a second field. You can simply use a fixed formula in your update query like CDbl([YourTextField]) / 100.