Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format SQL Query results in Excel
I will have a query that returns a lot of similiar fields per row, think:
Name1 Info1 Extra1 Name1 Info1 Extra2 Name1 Info1 Extra3 Name2 Info2 Extra4 Name2 Info2 Extra5 I'd like to be able to format it as such: Name1 Info1 Extra1 Extra2 Extra3 Name2 Info2 Extra4 Extra5 Basically, remove repeating data withing a "set". I know how to do it via SQL (thanks to some help), but not within Excel. Thanks! EggHeadCafe - Software Developer Portal of Choice ..NET Beginner's Guide To UI, Business, Data Layers http://www.eggheadcafe.com/tutorials...-guide-to.aspx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format SQL Query results in Excel
You may be able to put the SQL statements into the query you have in excel.
Excel has a built-in query editor that allows you to enter SQL. In excel 2003 it is located at the following menu. First select any cell in a returned query Data - Import External Data - Inport Data - Edit Query Then look for the SQL box in the edit Query Menu. "Richard Brust" wrote: I will have a query that returns a lot of similiar fields per row, think: Name1 Info1 Extra1 Name1 Info1 Extra2 Name1 Info1 Extra3 Name2 Info2 Extra4 Name2 Info2 Extra5 I'd like to be able to format it as such: Name1 Info1 Extra1 Extra2 Extra3 Name2 Info2 Extra4 Extra5 Basically, remove repeating data withing a "set". I know how to do it via SQL (thanks to some help), but not within Excel. Thanks! EggHeadCafe - Software Developer Portal of Choice ..NET Beginner's Guide To UI, Business, Data Layers http://www.eggheadcafe.com/tutorials...-guide-to.aspx |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format SQL Query results in Excel
In Excel, the easiest way to get the formatting you describe is to convert
your data into a pivot table. A pivot table will naturally remove the repeat values (leaving them blank) and will organize the data as you show in your example. HTH, Eric "Richard Brust" wrote: I will have a query that returns a lot of similiar fields per row, think: Name1 Info1 Extra1 Name1 Info1 Extra2 Name1 Info1 Extra3 Name2 Info2 Extra4 Name2 Info2 Extra5 I'd like to be able to format it as such: Name1 Info1 Extra1 Extra2 Extra3 Name2 Info2 Extra4 Extra5 Basically, remove repeating data withing a "set". I know how to do it via SQL (thanks to some help), but not within Excel. Thanks! EggHeadCafe - Software Developer Portal of Choice ..NET Beginner's Guide To UI, Business, Data Layers http://www.eggheadcafe.com/tutorials...-guide-to.aspx |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format SQL Query results in Excel
Note: the Extra2/3/5 is supposed to be under the other Extra "columns", not left-aligned.
Richard Brust wrote: Format SQL Query results in Excel 12-Oct-09 I will have a query that returns a lot of similiar fields per row, think: Name1 Info1 Extra1 Name1 Info1 Extra2 Name1 Info1 Extra3 Name2 Info2 Extra4 Name2 Info2 Extra5 I'd like to be able to format it as such: Name1 Info1 Extra1 Extra2 Extra3 Name2 Info2 Extra4 Extra5 Basically, remove repeating data withing a "set". I know how to do it via SQL (thanks to some help), but not within Excel. Thanks! EggHeadCafe - Software Developer Portal of Choice Javascript Debugging Tools for AJAX Developers http://www.eggheadcafe.com/tutorials...ging-tool.aspx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why are access query results different in Excel | Excel Discussion (Misc queries) | |||
exporting from sql query results to a excel workbook | Excel Programming | |||
Access query results to Excel | Excel Discussion (Misc queries) | |||
VBA - query an Access table - results in Excel | Excel Programming | |||
Complex Query Not Able To Get Results in Excel | Excel Programming |