troubleshooting Question

Export date field via a query to an Excel file

Avatar of SteveL13
SteveL13Flag for United States of America asked on
Microsoft Access
3 Comments3 Solutions83 ViewsLast Modified:
I am exporting a query result to an Excel file.  The query contains a date field.  The date field is Short Date by default.  But when for example 3/14/2017 gets exported to the Excel file it looks like 3/14/2017  12:00:00 AM

Why is this happening?

The export VBS code is:

DoCmd.TransferText acExportDelim, , "qryRecords", strCSV & Environ("userProfile") & "\Desktop\" & "Records " & Format(Now, "mm-dd-yyyy_hh-nn") & ".csv", True

Open in new window

Paul Cook-Giles
Senior Application Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros