ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Converting all leading zeros (https://www.excelbanter.com/excel-discussion-misc-queries/241984-converting-all-leading-zeros.html)

bluegrassstateworker

Converting all leading zeros
 
Because of a backlog with our .NET programmer, I am working with a
report that was extracted from an SQL database to an Excel file. I
have linked the Excel file to Access to provide reports in a specific
format so that all I have to do is run the extract then overwrite the
existing XLS extract. However, I have noticed that there are
sometimes leading zeros in some of the entries which could be either
in the month and/or the day. Even worse, some years are only two
digits. I need the format to be m/d/yyyy (only 1/1/2009 - not
01/01/09 or any variation thereof) for my calculation in the report to
work. The extract has over a dozen columns with dates I will need to
validate. Any ideas or links so that I can apply to format properly
appreciated.

MyVeryOwnSelf[_2_]

Converting all leading zeros
 
... there are
sometimes leading zeros in some of the entries which could be either
in the month and/or the day. Even worse, some years are only two
digits. I need the format to be m/d/yyyy (only 1/1/2009 - not
01/01/09 or any variation thereof) for my calculation in the report to
work. The extract has over a dozen columns with dates I will need to
validate.


Maybe a formula like this would help:
=TEXT(DATEVALUE(A1),"m/d/yyyy")




All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com