?
Solved

2 different sql queries inside 1 excel worksheet...

Posted on 2012-09-11
6
Medium Priority
?
385 Views
Last Modified: 2012-09-13
Hi Experts,

I have an Excel workbook with several worksheets.. Each worksheet is using an SQL Query  with a Cell as a Filter.. (data is entered into a cell and presto the data is refreshed)

One of these worksheets needs to have an additional SQL Query added  2 rows after the 1st sql query data is displayed in worksheet.. this additional SQL Query will filter data on the cell that the first query has utilized..

Hopefully this makes sense
0
Comment
Question by:Mikeyman_01
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 38392093
> this additional SQL Query will filter data on the cell that the first query has utilized..

Do you mean that the 2nd query is using a parameter, and that parameter comes from the cell filled by the 1st query?
0
 

Author Comment

by:Mikeyman_01
ID: 38392209
Yes..exactly
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 38392383
I actually just tried it in my excel 2003, and it worked as expected: when I change the value in A1, both cells below change.

query 1
query 2
Isn't this what you see? Do you have "refresh automatically" in both?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Mikeyman_01
ID: 38392408
Yes I have exactly what your are doing.. The problem is getting the 2 seperate sql queries that are written in microsoft query to show...I can only create 1 sql query per worksheet
0
 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 2000 total points
ID: 38392546
> I can only create 1 sql query per worksheet

why only one?

Here's the sample we created for you:

https://filedb.experts-exchange.com/incoming/ee-stuff/8282-Q_27861268.zip

the worksheet has two queries from Access database; to make it work, open each query in Microsoft Query, switch to SQL view, and adjust the path of the mdb file.

Once you change the value in A1, both will change.
0
 

Author Comment

by:Mikeyman_01
ID: 38394838
Perfect response.. Thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question