Format SQL Query results in Excel

R

Richard Brust

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/tutorial...b340-2e8c8cefd9d7/net-beginners-guide-to.aspx
 
J

Joel

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.
 
E

EricG

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
 
R

Richard Brust

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/tutorial...b-15d093c0c3ea/javascript-debugging-tool.aspx
 
Top