+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    10-10-2007
    Posts
    7

    How to use column as input to SQL

    I need to create a spreadsheet that allows a user to input a column of data that will then be used, one value at a time, as a parameter in an SQL query. For instance, my query would be something like :

    SELECT A, B, D, K, R
    FROM TABLE1, TABLE2, TABLE3
    WHERE A= D AND K= R AND (B=?)

    so that the values from the column of data are used in the comparison to B.

    Am I making any sense? If so, is there a way to do this? Much obliged at any help you could provide.

  2. #2
    Forum Contributor
    Join Date
    08-30-2007
    Location
    Vancouver, B.C.
    Posts
    110
    When you import the Query into Excel, edit the query in the Microsoft Query editor.

    Once in the editor, activate the Criteria view (View -> Criteria). Add each field that you want user input.

    For the criteria of each field, put [A DISCRIPTION].

    Once you are done, go to File -> Return Data to Microsoft Office Excel. For each user unput pop-up, just leave it blank.

    Once you have selected a location for your data, a pop-up will ask you for user input for the criterias you have entered. Point it to your desired cell.

  3. #3
    Registered User
    Join Date
    10-10-2007
    Posts
    7
    Unfortunately, what you've suggested only allows me to use the value from a single cell as input.

    What I want is to give it a column and have it generate the data using each cell from that column and output the results. From the digging I've done since first posting, I think that may not be supported. Am I correct in thinking that?

  4. #4
    Forum Contributor
    Join Date
    08-30-2007
    Location
    Vancouver, B.C.
    Posts
    110
    If you are using Access, all you have to do is link the table to the excel work sheet then you write your Query.

Thread Information

Users Browsing this Thread

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

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.2.0