Export query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to export a table that contains date fields to a text file. I
need these dates to be formatted as dd/mm/yyyy. If I use the format date
function then the date appears as text. If I don't use the format function
then the dates appear with hh:mm:ss. How do I format the date so that it
exports as a date field only not text.
 
Marianne,

Exporting to a text file, the dates will be exported as text anyway, and
there's nothing you can do about it! What do you mean "so that it
exports as a date field only"?

The general answer is: imposing a format on the table field won't do the
trick when exporting. Make a query on the table, and istead of including
the date field per se, use a calculated field on it, something like:
ExpDate: Format([YourDateFieldHere], "dd/mm/yyyy")
Then export the query instead of the table, and the trick is done.

HTH,
Nikos
 
Nicos,

I am exporting using a query and if I don't format the date, it exports
without the text marks, but it includes the time. If I use the format
function then it exports without the time, but with the text marks. I need to
be able to export the query as a date field (no time), and without the
quotation marks.

Marianne

Nikos Yannacopoulos said:
Marianne,

Exporting to a text file, the dates will be exported as text anyway, and
there's nothing you can do about it! What do you mean "so that it
exports as a date field only"?

The general answer is: imposing a format on the table field won't do the
trick when exporting. Make a query on the table, and istead of including
the date field per se, use a calculated field on it, something like:
ExpDate: Format([YourDateFieldHere], "dd/mm/yyyy")
Then export the query instead of the table, and the trick is done.

HTH,
Nikos
I am trying to export a table that contains date fields to a text file. I
need these dates to be formatted as dd/mm/yyyy. If I use the format date
function then the date appears as text. If I don't use the format function
then the dates appear with hh:mm:ss. How do I format the date so that it
exports as a date field only not text.
 
Marianne,

Text marks? Now we're getting somewhere... so your export spec has " or
' as Text qualifier. The only straight-forward solution I can propose is
to change that to nothing; this way you'll get rid of the quotes around
the (formatted) date, but the same will go for all other text strings.
Can you live with that? Personally I prefer it that way.
The only workaround I can think of, if the above is not acceptable, is
to resort to some VBA code to build the exported file line by line, in
which case you can have absolute control of what you export.

HTH,
Nikos
Nicos,

I am exporting using a query and if I don't format the date, it exports
without the text marks, but it includes the time. If I use the format
function then it exports without the time, but with the text marks. I need to
be able to export the query as a date field (no time), and without the
quotation marks.

Marianne

:

Marianne,

Exporting to a text file, the dates will be exported as text anyway, and
there's nothing you can do about it! What do you mean "so that it
exports as a date field only"?

The general answer is: imposing a format on the table field won't do the
trick when exporting. Make a query on the table, and istead of including
the date field per se, use a calculated field on it, something like:
ExpDate: Format([YourDateFieldHere], "dd/mm/yyyy")
Then export the query instead of the table, and the trick is done.

HTH,
Nikos
I am trying to export a table that contains date fields to a text file. I
need these dates to be formatted as dd/mm/yyyy. If I use the format date
function then the date appears as text. If I don't use the format function
then the dates appear with hh:mm:ss. How do I format the date so that it
exports as a date field only not text.
 
Back
Top