Export date without time and without "" quotes around date.

G

Guest

Hi.

I need to export a date field to .csv format without the time and without
the "" quotes around the date.

I've tried FormatDateTime and Format and I get a set of "" quotes around the
date and I can't have that.

I've tried CDate and I get the time.

Please help
Thanks
Lisa
 
G

Guest

Close but no cigar! I created a query that has a date/time field holding
time. In the query I put the following.
FormatDate: Format([DateAndTime],"mm/dd/yyyy")

As you already know, exporting the above will put "" around the date. Here's
the trick:
Start exporting the query manually.
When the Export Text Wizard dialog box appears, you'll see an Advanced
button towards the lower left. Click on it.
Go to the field in question.
Up near the top you'll see the Text Qualified dropdown. Set it to {none}.
Next click on the Save As button and save the export spec. Remember the name.
Then click on the OK button and finish the export with options such a Comma
and field names as necessary.
See it the export looks right.

The reason to save the export spec is this: If you are going to do this same
task over and over, you can automate the process either in a function or
macro.

In a macro use the TransferText and there is a place for the export
specification name.

In a function or module, the TransferText Action has a place for the export
spec argument. It would look something like this:

DoCmd.TransferText acExportDelim, "Standard Output", _
"External Report", "C:\Txtfiles\April.doc"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top