MS Access链接表自动长整数
我的访问数据库中有大量链接表,这些表将定期刷新并通过查询进行操作.但是,访问会自动将一些重要字段确定为长整数,因为该字段的起始值通常为0.如果该值不为0,则最多升至4位小数.由于我有很多表格,并且每周都会用同名的新表格(因此称为链接)替换它们,因此手动更改字段格式以在excel文档本身中加倍是不可行的.有什么方法可以重写此方法,以便任何具有数字"字段的链接表都自动成为双精度值?
I have a large amount of linked tables in my access database that are going to be refreshed regularly and manipulated via queries. However, access is automatically determining some important fields as long integers because the beginning values of the field are usually 0s. When the value is not 0, it is goes up to 4 decimal places. Since I have so many tables and since they will be replaced each week with a new table of the same name (thus the link), it is not feasible to manually change the formatting of the fields to double within the excel document itself. Is there any way to override this so that any linked table with a field that is "number" is automatically a double?
基本上,我将每周运行将要导出到excel文档的报告.我已经设置了一个活动"文件夹,其中包含我需要导入的当前excel文件.每周都会删除活动文件夹中的excel文件,并用相同名称和格式但有新数据的文件替换.这就是为什么我使用链接表到那些文件的原因.
Basically I will be running reports that are going to be exported to excel documents each week. I have set up an "active" folder that has the current excel files I need to import. Each week the excel files in the active folder will be deleted and replaced with files of the same name and format, but with new data. This is why I am using linked tables to those files.
链接表示例:
revised_full_cost change
615.194 0
402.402 0
1548.193 -4464
5329.836 0
对比实际的excel文件:
Versus the actual excel file:
revised_full_cost change
615.194 0
402.402 0
1548.193 -4464.207
5329.836 0
如您所见,链接表将更改"字段确定为整数,并在需要小数时四舍五入
As you can see the "change" field is being determined as an integer by the linked table and rounding when I need the decimals
弄清楚了(我觉得很蠢):
Figured it out (and I feel dumb):
链接表时,在执行链接表向导步骤时,可以为每个字段选择所需的格式.
When linking tables you can choose the desired format for each field when going through the linked table wizard steps.