Results 1 to 12 of 12
  1. #1
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199

    Query Results not pulling through into Excel or Tableau


    Hello,

    This is really strange but I created a query in Access which works fine, showing my data as desired. However when i try to import that query into Microsoft Excel or Tableau, which I do often, all of the records are blank. Doesn't make any sense to me, anyone have any ideas?

    Thanks,

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Not enough info to give a good answer.

    How are you importing the data from Access to Excel?
    - Copying the data from the query and pasting into Excel?
    - Using automation?
    - Using code?

    Details please........

  3. #3
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Steve,

    I'm using Data > From Access process to import. This usually works fine and I use it often.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I've imported the data from 5 queries in 5 different dBs and didn't have any problems.
    I would have to say that there is possibly a problem with the query in Access. Does it have any parameters in the query?

  5. #5
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    hi Steve, no parameters on this one. Just criteria to filter a text field.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Are the parameters hard coded in the query or are you referring to a control on a form?

  7. #7
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    hard coded and here's the SQL

    SELECT [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].VisitsFROM {Data Feed]
    GROUP BY [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].Visits
    HAVING ((([Data Feed].[Exit Links]) Like "*Plan_Detail*"));

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    "Month" is a reserved word and shouldn't be used for object names. Plus it is not descriptive.... "Month" of what???
    Shouldn't use spaces in object names.

    Does the data really have an underscore in the data? ......-> Like "*Plan_Detail*"

    There is a opening brace instead of an opening bracket in the FROM clause.....-> FROM {Data Feed]
    Code:
    SELECT [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].Visits 
    FROM {Data Feed]
    GROUP BY [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].Visits
    HAVING ((([Data Feed].[Exit Links]) Like "*Plan_Detail*"));

  9. #9
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Steve, it seems to have something to do with the Like expression. When I remove that it works fine. Problem is I need to use it! Any thoughts?

  10. #10
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Hmmmmmm....

    Could try changing the query to use WHERE instead of HAVING.

    Create a new query, change to SQL view and paste in the following SQL
    Code:
    SELECT [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].Visits 
    FROM [Data Feed]
    WHERE [Data Feed].[Exit Links] Like "*Plan_Detail*"
    GROUP BY [Data Feed].Month, [Data Feed].[Exit Links], [Data Feed].Visits;
    Change to Design view to see what it looks like in the query designer, save the query and execute it. It should return the same results as the original query.
    Then try an import from Excel using the new query.

  11. #11
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Steve, thanks but that still didn't work for the Excel import.

  12. #12
    accessmatt is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    199
    Steve, I just used Access's Make Table feature on that query to make an actual table and that worked for Excel. Not sure why as I'm usually able to import queries directly into Excel but glad I found a solution.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 04-22-2013, 04:21 PM
  2. Exporting Query results to Excel with VBA
    By Tomlon in forum Programming
    Replies: 1
    Last Post: 01-29-2013, 09:56 PM
  3. Replies: 1
    Last Post: 08-31-2012, 04:41 AM
  4. Group by pulling incorrect results
    By jpawson74 in forum Queries
    Replies: 7
    Last Post: 03-28-2012, 09:46 AM
  5. Exporting Query Results to an existing Excel Workbook
    By Dnphm in forum Import/Export Data
    Replies: 3
    Last Post: 07-13-2010, 11:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums