Solved

Exporting date fields to Excel

Posted on 2015-02-19
6
116 Views
Last Modified: 2015-02-19
Exporting my report from Access to Excel causes Date Fields to format incorrectly.  This can be resolved by reformatting the date column after exporting, but I would like for that to be automatic.

Attached is a sample Access database to illustrate the issue

Open the report and manually export to Excel.

Windows 7, Access 2010, Excel 2010
ExportDateIssue.accdb
0
Comment
Question by:Wayne Markel
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40619048
It's confused because of your formatting of mm-yy.

Change the report to dd-mmm-yy, and it will export fine.
0
 

Author Comment

by:Wayne Markel
ID: 40619078
Yes that works to export Day, Month, and Year, but my client wants only the month and year in the exported Excel file since it is a billing period not a billing date.  They can reformat to mm/yy after opening the Excel file, but would like that to be automatic.  Yes it is a cosmetic issue, but that is what they have requested.

Am I misunderstanding your answer?
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40619098
Then I suggest changing your query to:

SELECT tblLossAllocation.ID, Format([tblLossAllocation].[BillingPeriod],"mm/yy") AS BillingPeriod
FROM tblLossAllocation;
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Closing Comment

by:Wayne Markel
ID: 40619121
Immediate response and followup.
0
 
LVL 12

Expert Comment

by:FarWest
ID: 40619160
or change the control source of the period to
=Format([BillingPeriod],"mm/yy")
(requires giving the control another name)
0
 

Author Comment

by:Wayne Markel
ID: 40619172
Super!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Target.Address conflict in Excel VBA 3 25
Find the duplicates in 32 27
Array not populating all cells in Excel 6 26
Email question 12 26
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question