Export select distinct into sheets in excel
I'm looking for a functionality where i can export data from a database into excel where each select distinct result should be written into a separate tab.
I have 74 distinct numbers from :
select distinct(nr) from table;
The records for nr 1 should be written to sheet 1
The records for nr 2 should be written to sheet 2
and so on.
How would that be done?
You probably want to use .NET to create the spreadsheet. Or maybe VBA within Excel.
I can't imagine that anything else is going to interface with Excel and create the files
the way you want.
this space intentionally left blank
May be a two steps process... first spool out "csv" files with the output of the queries, then importing them into Excel.
Pablo (Paul) Berzukov
Author of Understanding Database Administration
available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Your requirements are incomplete, please post a working test case:
Originally Posted by Vestlink
- create table
- insert statements
- the result you want with these data
- Explain with words and sentences the rules that lead to this result
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Click Here to Expand Forum to Full Width