Results 1 to 7 of 7

Use column heading and row label as sql query parameters for multiple cells

Threaded View

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Wales, Boyo
    MS-Off Ver
    Excel 2007
    Posts
    42

    Use column heading and row label as sql query parameters for multiple cells

    I currently have a worksheet (attached) where I need to pass some parameters to a SQL query.

    For each cell where I have to retrieve a value I need to pass the date range and row label to a sql query.

    So for example for C3:

    SELECT totalsales From tblSales WHERE SeasonCode = "text value from A3" AND Date BETWEEN "value from C2"
    The result of this query needs to then be inserted into C3

    Ideally I need to then loop through each cell in this row up until the last column of data (in this case column Q) but number of columns will vary.

    I then need to do the same for each row where there is a season code

    I cant for the life of me figure out a neat way of doing this and would really appreciate any help that anyone can offer.
    Attached Files Attached Files
    Last edited by TheCyrusVirus; 05-12-2010 at 07:13 AM.

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