+ Reply to Thread
Results 1 to 2 of 2

link an sql table to excel

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    link an sql table to excel

    hi there
    i have linked a table from an sql to my excel.
    can i pass a filter to the connection link inorder to get specific record ffrom sql to excel

    thanks in advance for any help
    ids

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: link an sql table to excel

    Post the command string here. To get the command string, Go to Data -> Connections and select the connection. Then select Properties. On the second tab you will see two boxes: on has the connection string: this tell Excel what data source you are using. The second box is the command string, and this should reflect the SQL you are using. Select all the text in this box and paste it here.

    Then tell me which one of the fields you want to filter on and the nature of the data (date, string whatever) and what the valid values can be.

    I have a system that rewrites the command string "on the fly." It's simple VBA and an Excel Table that contains the SQL.

    I'm making you do the exercise above so you can understand the concept on which the code is based. If you attach an actual workbook, I can show you how it is done using your own data - well, your own data structure. Clearly I do not have access to your data. I can do the coding without it, I just can't test it.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Link excel table to access database
    By c00ly81 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-02-2016, 09:56 AM
  2. Replies: 10
    Last Post: 09-07-2014, 11:54 PM
  3. [SOLVED] Help Needed : How to link excel table with power point table
    By Elangovan89 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-11-2014, 12:52 PM
  4. Import Excel table referenced in a link stored in an Access table
    By Dionysos in forum Access Tables & Databases
    Replies: 0
    Last Post: 01-16-2013, 08:09 PM
  5. How to link Excel Table to ListBox using VBA
    By karthisucc9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-27-2012, 02:50 AM
  6. excel link to word table
    By gabrielrms in forum Excel General
    Replies: 2
    Last Post: 03-30-2007, 11:07 PM
  7. [SOLVED] Link Access table to Excel worksheet
    By dalesrunner in forum Excel General
    Replies: 1
    Last Post: 03-27-2005, 08:06 PM

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