将日期字段导出到文本文件 [英] Exporting date fields to a text file

查看:69
本文介绍了将日期字段导出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自动执行一个过程,该过程涉及将.txt文件导入现有表,更改每个记录中的日期,然后再将该表导出为.txt文件。一个字段包含日期(yyyy-mm-dd),另一个字段包含日期/时间(yyyy-mm-dd hh:nn:ss)。如果我手动导出,则.txt文件中的导出数据是正确的,但如果我使用transfertext操作和导出规范自动执行该过程,则日期字段导出时间(00:00:00)添加到日期。无论现有Access表中的字段是文本字段还是日期/时间字段,都可以执行此操作。如何在仅限日期字段中阻止Access为导出的数据添加时间?时间字符不会出现在Access表中,只出现在导出的.txt文件中。

I am attempting to automate a process involving importing a .txt file into an existing table, changing a date in each record, then exporting the table, again as a .txt file. One field contains a date (yyyy-mm-dd) and another a date/time (yyyy-mm-dd hh:nn:ss). If I do the export manually, the exported data in the .txt file is correct, but if I automate the process using the transfertext action and an export specification, the date field exports with time (00:00:00) added to the date. It does this whether those fields in the existing Access table are text fields or date/time fields. How can I prevent Access from adding time to the exported data in the date only field? The time characters don''t appear in the Access table, only in the exported .txt file.

推荐答案


我正在尝试自动化一个过程,包括将.txt文件导入现有表,更改每个记录中的日期,然后再导出该表作为.txt文件。一个字段包含日期(yyyy-mm-dd),另一个字段包含日期/时间(yyyy-mm-dd hh:nn:ss)。如果我手动导出,则.txt文件中的导出数据是正确的,但如果我使用transfertext操作和导出规范自动执行该过程,则日期字段导出时间(00:00:00)添加到日期。无论现有Access表中的字段是文本字段还是日期/时间字段,都可以执行此操作。如何在仅限日期字段中阻止Access为导出的数据添加时间?时间字符不会出现在Access表中,仅出现在导出的.txt文件中。
I am attempting to automate a process involving importing a .txt file into an existing table, changing a date in each record, then exporting the table, again as a .txt file. One field contains a date (yyyy-mm-dd) and another a date/time (yyyy-mm-dd hh:nn:ss). If I do the export manually, the exported data in the .txt file is correct, but if I automate the process using the transfertext action and an export specification, the date field exports with time (00:00:00) added to the date. It does this whether those fields in the existing Access table are text fields or date/time fields. How can I prevent Access from adding time to the exported data in the date only field? The time characters don''t appear in the Access table, only in the exported .txt file.



我在Windows 2000上使用Access 2003。

I''m using Access 2003 on Windows 2000.



我正在尝试自动化一个过程,包括将.txt文件导入现有表,更改每个记录中的日期,然后再导出该表作为.txt文件。一个字段包含日期(yyyy-mm-dd),另一个字段包含日期/时间(yyyy-mm-dd hh:nn:ss)。如果我手动导出,则.txt文件中的导出数据是正确的,但如果我使用transfertext操作和导出规范自动执行该过程,则日期字段导出时间(00:00:00)添加到日期。无论现有Access表中的字段是文本字段还是日期/时间字段,都可以执行此操作。如何在仅限日期字段中阻止Access为导出的数据添加时间?时间字符不会出现在Access表中,仅出现在导出的.txt文件中。
I am attempting to automate a process involving importing a .txt file into an existing table, changing a date in each record, then exporting the table, again as a .txt file. One field contains a date (yyyy-mm-dd) and another a date/time (yyyy-mm-dd hh:nn:ss). If I do the export manually, the exported data in the .txt file is correct, but if I automate the process using the transfertext action and an export specification, the date field exports with time (00:00:00) added to the date. It does this whether those fields in the existing Access table are text fields or date/time fields. How can I prevent Access from adding time to the exported data in the date only field? The time characters don''t appear in the Access table, only in the exported .txt file.



无论字段的格式如何,Access都会随时间存储它。尝试将字段的格式更改为mm / dd / yyyy。看看是否有效。


Mary

Regardless of how the field is formatted Access stores it with the time. Try changing the format of the field to "mm/dd/yyyy" and see if that works.

Mary


我有同样的问题。

我运行的脚本是只需将表转储到文本文件中以供其他用户选择即可。日期''字段的属性设置为短日期字段。它们只显示Access中的日期。查看文本文件时出现问题,所有其余数据都很好,但日期已添加时间。时间字段也添加了1899年的日期。这对我来说是个问题,因为我需要导出到固定长度的字段。

我将Access中的日期和时间字段的属性更改为dd / mm / yyyy,时间更改为00:00 in输入掩码但无济于事。


请帮助


顺便说一下我也使用Access 2003
I have the same issue.
I run a script that is simply dumping a table into a text file for another user to pick up. The attributes of the date''s fields are set to "Short Date" and they display only the date in Access. The issue comes when the text file is viewed, all the rest of the data is fine but the Date has had a time added. The time fields have also had a date from year 1899 added. This is an issue for me as I need to export into fixed length fields.
I changed the attributes of the date and time fields in Access to be dd/mm/yyyy and time of 00:00 in the Input Mask but to no avail.

Please help

By the way I am also using Access 2003


这篇关于将日期字段导出到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆