+ Reply to Thread
Results 1 to 5 of 5

date pasted as 1/2/1900 in excel instead of 1/1/1900

  1. #1
    Registered User
    Join Date
    04-10-2014
    Location
    hyderabad
    MS-Off Ver
    Excel 2010
    Posts
    2

    date pasted as 1/2/1900 in excel instead of 1/1/1900

    Hi ,

    In the database the date is 1/1/1900. But when I exactract to excel it is displaying it as 1/2/1900 (mm/dd/yyyy format).

    Can anyone please let me know why it is displaying like this.

    Thanks in Advance

    Regards
    Naveen

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: date pasted as 1/2/1900 in excel instead of 1/1/1900

    I have no idea is this is teh cause, but check your excel options under Advanced/When calculating this workbook, and see if you have 1904 date system checked. If so, uncheck it
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-10-2014
    Location
    hyderabad
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: date pasted as 1/2/1900 in excel instead of 1/1/1900

    It is already unchecked (1904 system date) in options. But no idea it looks like is it issue with 1900 leap year? or is it something else

    Regards
    Naveen

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: date pasted as 1/2/1900 in excel instead of 1/1/1900

    Where is the data coming from, and what (exactly) does the imported date look like?

  5. #5
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: date pasted as 1/2/1900 in excel instead of 1/1/1900

    Quote Originally Posted by ekkslatha View Post
    In the database the date is 1/1/1900. But when I exactract to excel it is displaying it as 1/2/1900 (mm/dd/yyyy format). Can anyone please let me know why it is displaying like this.
    In Excel, dates are stored as integers, namely the number of days since 12/31/1899.

    Thus, 1/1/1900 is the number 1, and 1/2/1900 is the number 2.

    So, when you "extracted to Excel", the number 2 was transfered from the database into the Excel.

    I cannot tell you how that happened because: (1) you do not say what database you used; and (2) you do not explain exactly how you "extracted to Excel".

    FYI, in VBA, the date constant #1/1/1900# is the number 2, not 1. So if you have read 1/1/1900 from a database into a VBA type Date variable, then stored that variable into an Excel cell, Excel would display 1/2/1900. Demonstration:
    Please Login or Register  to view this content.
    [EDIT] VBA and Excel sync up on 3/1/1900. And yes, the reason is that Excel thinks 2/29/1900 is a leap day, whereas VBA does not.
    Last edited by joeu2004; 10-25-2014 at 08:39 PM. Reason: typo: #1/1/1900# is 2, not #1/2/1900#

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro for changing the date from 02-Jan-1900 to 01-Jan-1900
    By Lavanya Anandan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2013, 07:08 AM
  2. How do I get Excel date to change from 1/1/1900?
    By Macdad in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. How do I get Excel date to change from 1/1/1900?
    By Debra Dalgleish in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 09:05 AM
  4. [SOLVED] How do I get Excel date to change from 1/1/1900?
    By Macdad in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  5. [SOLVED] How do I get Excel date to change from 1/1/1900?
    By Macdad in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1