Consulting

Results 1 to 6 of 6

Thread: Query in excel not importing numbers, just text.

  1. #1
    VBAX Regular
    Joined
    Apr 2005
    Posts
    31
    Location

    Question Query in excel not importing numbers, just text.

    Hello,
    I have this situation which I cannot solve:

    I use the Data-Import External Data-New Database Query-"Excel files" to import a sheet from an excel workbook to a new workbook.

    Everything gets imported exept the dates from the column field called "date fixed". In this field I have both dates and "XXX" in it.
    Example:
    What I need What gets imported Dates fixed Dates fixed xxx xxx 10/01/06
    XXX XXX 11/06/06
    xxx xxx 12/01/06
    xxx xxx XXX XXX
    The "xxx" gets imported, but anything that is a date or even looks like one does not.

    In access I don't have this problem. I wonder what else I can do to overcome this?

    Thanks

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Can you post a small sample?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Regular
    Joined
    Apr 2005
    Posts
    31
    Location
    Thank you for responding,

    The sample is attached.

    There are 2 tabs, One "Original", the other "Query".

    The Query sheet is the one that will not show both "Dates" and "xxx"'s on column "C". (Before, it wasn't showing the Dates??????)

    This is just a simple query from excel, what am I missing???

    Normally, I use the Data-Import External Data-New Database Query-"Excel files" to import a sheet from an excel workbook to a new workbook

    Thanks,

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    the sheets seem to be identical...why not just copy the sheet to a new workbook?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Why do you have the XXX/xxx in the cells without dates?

    That's probably causing Excel to regard that field as text rather than a date.

  6. #6
    VBAX Regular
    Joined
    Apr 2005
    Posts
    31
    Location
    Thanks for replying guys,

    For lucas' question: The sheets are identical to show that the dates were not imported. I want to query any Dates or even "xxx"'s into another sheet. You will notice that the "xxx"'s dont show, and for this query, I want everything to show.
    For Nories' question: This tells me that it is an invalid error, that it should not be followed up on. I also want everything to show as an example, so that can see that not all cells have been imported as it should have.
    For this query, what I want to do is to be able to query anything from column "C" so that I may know how many errors were fixed by a certain date. I can filter it from the original sheet, but then it will have to be in a shared format, and to filter it (20,000 lines) takes tooooooooooooo loooooong.
    So, I want to query that information from another workbook so that I won't interfere with anyone elses work.

    I hope that gives you more information.

    Thanks,

Posting Permissions

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