简体   繁体   中英

How to format a column with this format: 000.000 in MS Access

I have a column that I imported as text. It has numbers like 511.182, 367.340, 342.001, etc.

I tried doing:

UPDATE databasename 
SET accountcode = format(accountcode,"000.000")
WHERE len([accountcode])>0;

However, this just caused every row to have the last three digits after the period to be 000. In the example I gave, it would now show as: 511.000, 367.000, and 342.000

Thanks for the solution.

Had to make it a text field, and then did the following code:

UPDATE databasename
SET accountcode = format(val(accountCode),"000.000")
WHERE len([accountcode])>0;

Worked perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM