+ Reply to Thread
Results 1 to 2 of 2

MySQL Query from Existing Database Connection

  1. #1
    Forum Contributor
    Join Date
    05-24-2014
    MS-Off Ver
    Microsoft Office 2013
    Posts
    113

    MySQL Query from Existing Database Connection

    I followed this link's instructions on how to set up a database connection. It works great but the problem I have is narrowing down the data I import. I would like a solution that would allow me narrow down my data with MySQL. I don't have MS EXCEL Professional Plus 2013 so I don't get the built in add-in for this. Is there a way to run a MySQL query on this existing connection?

    Thanks,
    Rob

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: MySQL Query from Existing Database Connection

    Based on what you did, when you get to the excel portion of that tutorial, you hit "Existing Connections", you choose the connection, and hit "Open" correct?
    Then you have a window: "Import Data", and there should be a button labelled properties, if you hit that, the connection properties box comes up, and it defaults to the "Usage" Tab, but there is also one labelled "Definition". Choose that one, and the bottom textbox has what is marked as "Command text" which is really the sql... you can add criteria there. It is hard to be specific without knowing what you want to filter and what your table's field names are, but your default probably looks like SELECT * FROM `database_name'.'table_name'
    You can add to that: WHERE `field_name` = criteria
    you need to surround criteria in single quotes ' if it is text, and without the quotes if it is numeric
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

+ 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. Change workbook connection from OLEDB to Database Query?
    By walterbyrd in forum Access Tables & Databases
    Replies: 9
    Last Post: 09-25-2019, 08:53 PM
  2. Connection between Excel and MySql Workbench
    By joseto_caviedes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2014, 09:08 AM
  3. MS Query connection changing database location
    By Kburges in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2013, 06:39 PM
  4. Cube Analysis - MySQL Connection
    By gatornation in forum Excel General
    Replies: 0
    Last Post: 04-30-2007, 10:41 AM
  5. [SOLVED] connection to internet mysql-database
    By masterphilch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2005, 03:06 PM

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