Avatar of baleman2
baleman2
 asked on

Microsoft Query output to Excel Spreadsheet

We use Microsoft Query as a query builder and export the data to an Excel spreadsheet.  When the spreadsheet opens, Excel's column names ( A thru ZZ) appear with the Data Table's Field names just below.

These field names can be quite long with the resultant data displayed in the column under the field name just being 2 characters wide.  An example would be a Data Field name being displayed as "Branch Number" and the data itself being "01" or "02" or "03".  I can't modify the Field Name itself because of other software that is dependent on those Field Names for data.

I was thinking of formatting the Field Name as:
B  N
R  U
A  M
N  B
C   E
H   R

using a SQL statement of some kind in the original query to display it as shown.

The purpose of this is so that I can display more Field Names with data on the printed page.  Right now, (even in Landscape mode) I can't get all the data squeezed in that I want the end user to see.  If I could turn the Field Names on edge or even at a tilt:
B  N
 R  U
  A  M
   N  B
    C   E
      H  R

this would allow me to add more columns that would print on a single piece of paper.

Please Advise.
Microsoft ExcelMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Daniel Van Der Werken

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Missus Miss_Sellaneus

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Daniel Van Der Werken

You could do like Missus Miss Sellaneus says and it would work like what I have in cell A1. If you want the results from B1, then do like I show:
Alignment SettingThen, squeeze the row down so it just holds two characters and type in the text: B N R U A M N B C E H R
You'll see the B1 cell display:
branch-number.png
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy