Export fixed width

  • Thread starter Thread starter Ken Ivins
  • Start date Start date
K

Ken Ivins

Two questions. First I would like to export a table (tblCustomers) as a
fixed width format. The table field sizes are already set for their
respected field sizes. I would like to do this all with code. How do I do
this?

Second, when I did this in Access 2002 (Access 2000 format) using the
wizard, the date fields changed the format from "yyyymmdd" to"m/d/yy" and
added the time. The table is formatted correctly. I even tried to do it as a
query with the field formatted correctly and get the same results. Any idea
on how to fix this?

Thanks,
Ken Ivins
 
Set up an Export Specification and then use that specification in the
TransferText action.

You set up this specification by starting the export process manually, then,
when the Wizard window displays, click the Advanced button at bottom left.
Then you can set up the specification and save it as a name that you
provide. Once you've set it up and saved it, cancel the export.

Then use this specification name as the Specification argument of
TransferText.
 
Ken,

Thanks. I did this before but it was a while ago and I forgot. Thanks.

I still have the time problem. any idea on how to keep the time off the
date?

Thanks,
Ken
 
Use a query as the source for the export, not the table. The query should
select all the fields that you want to export except for the date field. For
that field, use a calculated field that formats the date field's contents:
JustDate: Format([DateField], "mm/dd/yyyy")

That will strip off the time when the value is exported. You can use
whatever format for date that you wish; my example uses mm/dd/yyyy.
 
Ken,

Thanks, for this follow up on a holiday weekend. I had additional trouble
because I had two date fields in the same query. I was not getting any
records. The real problem was that one of them was an "Is Null". I suspect
that was the issue. But since there is no data in that field, I do not have
to format it. So it is okay.

Thanks again.
Ken Ivins



Ken Snell said:
Use a query as the source for the export, not the table. The query should
select all the fields that you want to export except for the date field. For
that field, use a calculated field that formats the date field's contents:
JustDate: Format([DateField], "mm/dd/yyyy")

That will strip off the time when the value is exported. You can use
whatever format for date that you wish; my example uses mm/dd/yyyy.

--
Ken Snell
<MS ACCESS MVP>
Ken Ivins said:
Ken,

Thanks. I did this before but it was a while ago and I forgot. Thanks.

I still have the time problem. any idea on how to keep the time off the
date?

Thanks,
Ken
as
a I
do to"m/d/yy"
and it
 
Back
Top