+ Reply to Thread
Results 1 to 3 of 3

Reference/use a cell value in a SQL query in Excel 2007 - Query Wizard

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Reference/use a cell value in a SQL query in Excel 2007 - Query Wizard

    I would like to use a cell in a worksheet as a value in a SQL query in Excel 2007.

    Let's say for example I have the following query:

    SELECT DATE, TIME, PARTID
    FROM TABLE1
    WHERE PARTID = [Cell Value] --------> For example want it to be at Sheet1 Cell A1

    I am using Excel Query Wizard. My Query is working perfectly without any reference(a constant value), however, using an Excel Cell I do not know how to perform that.

  2. #2
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Reference/use a cell value in a SQL query in Excel 2007 - Query Wizard

    Can Anyone help me please??
    Last edited by trizzo; 02-01-2013 at 07:15 AM.

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Brazil
    MS-Off Ver
    Excel 2007 & 2013
    Posts
    268

    Re: Reference/use a cell value in a SQL query in Excel 2007 - Query Wizard

    I am in Microsoft Query, my query with a constant value(Let's say 300) is working perfectly, however, when I specify in the criteria [] to define a variable, and I run the query, I get the following error:
    "Function Sequence Error"

    SELECT TVSXX_APR_HV.PARTID, TVSXX_APR_HV.SYS_ID, TVSXX_APR_HV.TVS_SYS_ID
    FROM MVSI.TVSXX_APR_HV
    WHERE (TVXX_LPAR_HV.PARTID=?)

    The above query was set with ? automatically by Excel MS Query when I specified [] in the criteria.

    Can Anyone help me please?

+ Reply to Thread

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.6.0 RC 1