+ Reply to Thread
Results 1 to 8 of 8

Date Formats get changed

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    28

    Date Formats get changed

    When I open my data file (originally in .dbf format, in excel, the date field in some cell is normal i.e. dd/mm/yyyy but in many it chages to yyyymmdd (without even the slash-"/". Such misformated cells rows are approximately 40-45% out of total rows. Because of this trouble I can not use the converted file in excel. The original data file is generated through a accounting software being used since more than 20 years and have never encountered any mistake while using in dbase.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Date Formats get changed

    I think it would help to see examples of the dates that and are not converted.

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell c ontains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook. Don't upload a picture when you have a workbook question. None of us is inclined to recreate your data. Upload the workbook and manually add an 'after' situation so that we can see what you expect. In addition clearly explain how you get the results..
    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Date Formats get changed

    Thanks for an immediate reply. As asked attaching herewith both the files (1) TJNV1116.DBF & (2) Saved as TJNV1116.xlsx after opening the .dbf file. Thanks..

    .dbf file could not be aploaded...
    Attached Files Attached Files

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Date Formats get changed

    There's no .dbf file ...

  5. #5
    Registered User
    Join Date
    01-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Date Formats get changed

    It does not allow to upload .dbf file & gives a message saying "Invalid File"

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Date Formats get changed

    You could put it a zip file and upload that.

    Regards, TMS

  7. #7
    Registered User
    Join Date
    01-20-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Date Formats get changed

    Thanks for valued guidance. Attaching herewith zip file containing both files .xlsx & .dbf. The xlsx file is created by opening the .dbf file in excel in which come cells of Doc_date column (dd/mm/yyyy) are changed to yyyymmdd. I tried to reformate the cells by selecting the whole column but no success. But if you enter the date manually in dd/mm/yyyy it accept. This option is not feasible because of large number of rows. Awating for the valued suggestion/guidance & solution. Thanks..
    Attached Files Attached Files

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Date Formats get changed

    Interestingly, the file opens OK for me and the dates are all fine. It looks as though it must be a problem with Regional Settings. All the dates where the day is less than or equal to 12 are shown as dates in your file. However, they're probably not the date(s) you think they are. For example, the first date in your Excel file is 11/01/2006. When I open the .dbf file, the first date is 01/11/2006 which seems logical as all the dates appear to be for November 2006.

    When you are opening the file, it is taking what should be a dd/mm/yyyy formatted date and considering it to be a mm/dd/yyyy formatted date. Although wrong, it "copes" with dates where the day number could be a month number. It falls over when it gets to 13 because that is not a valid month (obviously).

    If you select the cells that look like dates, and choose Data | Text to Columns, Delimited, Next, Next, Column Data Format = MDY, Finish, it will convert the dates to what they should be.

    Similarly if you choose the text numbers that look like dates and choose the Column Data Format = YMD, it will fix those.

    You could ssort on column D first which will bring all the "dates" together followed by all the text. Then you convert all the "dates in one go followed by all the text.

    I've attached the .xlsx file I saved from the .dbf file for reference.

    Regards, TMS


    HTML Code: 
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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