Link to home
Start Free TrialLog in
Avatar of mscalafasd
mscalafasd

asked on

How to maintain leading zero in date field.

I have to export an Excel worksheet to a CSV file with one of the columns containing date information in the format of MM/DD/YYYY.

I have the correct format and then I change the column to text, but it still messes up any dates that being with 0 for the month, for example 02 for February.

How can I maintain the 0's?  The upload simply fails as of now, or at least 850 entries do.  I'm using Excel 2007, but I do have 2010 available if I need to use that instead.

I'm uploading student information into a state system.

Thanks for any help,

Matt
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Just tried to save as CSV a file with a field with the following formula:

= TEXT(A1, "mm/dd/yyyy")

where A1 was a date cell, and it kept the 0s.

HTH,
Dan
Avatar of mscalafasd
mscalafasd

ASKER

In addition, I can get it to display correctly, it's just when I export to a .CSV it does not maintain it...

I do the export and then I try the upload and it fails...

Thanks.
Thanks Dan I will try it!
Reformat the date format to 03/27/2014 without changing ti to text. I just tested it and it kept the leading zero using Excel 2010.
How do I apply that formula to that column Dan?
You cannot apply the formula to the same column (circular reference). You need to put it into another column.
For ex if your dates are in the column A, put that formula that will convert your dates to text into column B.
ASKER CERTIFIED SOLUTION
Avatar of mscalafasd
mscalafasd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Didn't need assistance