简体   繁体   中英

How to fire SQL query on Open worksheet of Excel sheet on runtime?

I am writing code to generate an Excel file. I am generating a detailed report in 3 sheets in single XLS file. I am able to write 1 detailed, sheet1. Now I want to fire SQL query on sheet1 table to generate sheet2 table.

My sheet1 contains 9 columns. Out of 7, one is price. I want to fire query like this:

Select Product_Name, City, State, Country,  SUM(price), Sub_Type, Description from Sheet1 Group By Product_Name, City, State, Country, Sub_Type, Description

...and save both work sheets.

How can I Fire such query, or use some other method to get the desired result?

我将在sheet2上创建一个数据透视表,该数据表是来自sheet1的输入。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM