gpt4 book ai didi

sql - 在 MS Access 中格式化

转载 作者:行者123 更新时间:2023-12-04 03:39:43 25 4
gpt4 key购买 nike

我正在尝试格式化 Access 表字段以包含下图中的所有值。但是,当我从 excel 复制并粘贴到 Access 表时,表中只显示有效数字。这些字段目前是 Text 数据类型,我已经尝试过 Number 数据类型,但值会四舍五入。我如何更正此问题以完成此任务?我可以运行 SQL 查询来返回预期的格式吗?

目前,如果我从 excel 复制并粘贴到 Access:

enter image description here

预期:

enter image description here

也许如果我将字段保留为 Text 数据类型,Format() 方法是否会使用以下方法将其整理出来:

SELECT Format(ExchangeRate, "#.######"), Format(ForeignGross, "#.##")  
FROM tab1;

最佳答案

在 Access 中,分别为这两个字段设置 Format 属性:

0.000000
0.00

切勿将金额或数量存储为文本。将字段 Data Type 更改为 Number 并使用 Field Size: DoubleFormat: 0.0000000.00分别。

关于sql - 在 MS Access 中格式化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66260795/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com