Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are access query results different in Excel DannyD Excel Discussion (Misc queries) 0 July 29th 07 04:54 AM
exporting from sql query results to a excel workbook OceanMist Excel Programming 2 July 20th 07 02:10 PM
Access query results to Excel piano banger Excel Discussion (Misc queries) 4 December 8th 06 09:32 AM
VBA - query an Access table - results in Excel rirus Excel Programming 3 August 21st 06 07:29 PM
Complex Query Not Able To Get Results in Excel cb22 Excel Programming 2 January 19th 06 01:47 AM


All times are GMT +1. The time now is 04:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"