doCmd.transferText problem

  • Thread starter Thread starter Randy K.
  • Start date Start date
R

Randy K.

I am using this command to output the results of a query to a .txt file.
The command runs without errors, but it turns a date field into a datetime
field in the .txt file. It doesn't show this during the output spec setup
and I have tried many different things (format, cdate, etc.) within the
query itself trying to stop this behavior, but the query and the 'preview'
it shows during the export wizard always displays just a date, but when I
look at the resultant .txt file, it has 0:00.00 added after every date and
this is causing problems for the program needing the .txt file.

TIA,
Randy K.
 
Randy K. said:
I am using this command to output the results of a query to a .txt
file. The command runs without errors, but it turns a date field into
a datetime field in the .txt file. It doesn't show this during the
output spec setup and I have tried many different things (format,
cdate, etc.) within the query itself trying to stop this behavior,
but the query and the 'preview' it shows during the export wizard
always displays just a date, but when I look at the resultant .txt
file, it has 0:00.00 added after every date and this is causing
problems for the program needing the .txt file.

That seems odd. If I have a date field in a query, and I use the Format
function to format it:

FormattedDate: Format([DateField], "short date")

that field when exported to text in my tests does not contain the time
portion that is bedeviling you. Does your export specification by any
chance define the field as Date/Time field? You may have to view the
spec while importing rather than exporting to find this out. If so, try
changing it to Text.
 
Back
Top