PC Review


Reply
Thread Tools Rate Thread

How do you rename table headers in a query using Offic 07?

 
 
DFoster
Guest
Posts: n/a
 
      28th Aug 2008
In older versions you could use AS after the field name and replace the name,
now that doesn't work. Example would be select dwdata.lstnme AS "Last".
With this in the query it would bring back a column heading of Last instead
of lstnme.
 
Reply With Quote
 
 
 
 
Duke Carey
Guest
Posts: n/a
 
      28th Aug 2008
I think you need to wrap the alias in single quotes

"DFoster" wrote:

> In older versions you could use AS after the field name and replace the name,
> now that doesn't work. Example would be select dwdata.lstnme AS "Last".
> With this in the query it would bring back a column heading of Last instead
> of lstnme.

 
Reply With Quote
 
DFoster
Guest
Posts: n/a
 
      28th Aug 2008
It doesn't recognize the AS command anymore

"Duke Carey" wrote:

> I think you need to wrap the alias in single quotes
>
> "DFoster" wrote:
>
> > In older versions you could use AS after the field name and replace the name,
> > now that doesn't work. Example would be select dwdata.lstnme AS "Last".
> > With this in the query it would bring back a column heading of Last instead
> > of lstnme.

 
Reply With Quote
 
Duke Carey
Guest
Posts: n/a
 
      29th Aug 2008
Are you using MS Query?


I just did this in MS Query with Excel 2007, using this SQL

SELECT Activity.LocationSize, Activity.Function AS 'Fnctn',
Activity.ActivityCount
FROM Activity Activity, location location
WHERE Activity.LocationSize >= location.Lbound AND Activity.LocationSize <=
location.Ubound

It returns the data to Excel with the 2d column's heading being 'Fnctn' -
it unfortunately includes the single quotes in Excel



"DFoster" wrote:

> It doesn't recognize the AS command anymore
>
> "Duke Carey" wrote:
>
> > I think you need to wrap the alias in single quotes
> >
> > "DFoster" wrote:
> >
> > > In older versions you could use AS after the field name and replace the name,
> > > now that doesn't work. Example would be select dwdata.lstnme AS "Last".
> > > With this in the query it would bring back a column heading of Last instead
> > > of lstnme.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to rename table columns in excel from a query DFoster Microsoft Excel Worksheet Functions 3 26th Aug 2008 10:24 PM
ADO/DAO query to rename table fields? sbcglobal Microsoft Access Queries 1 8th Feb 2005 12:45 PM
user rename table from maketable query kathi Microsoft Access Database Table Design 2 21st Feb 2004 05:59 AM
Using VBA to rename Pivot Table Query Ron McCormick Microsoft Excel Programming 3 7th Nov 2003 03:28 AM
Re: Using VBA to rename Pivot Table Query Ron McCormick Microsoft Excel Programming 0 6th Nov 2003 10:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:55 PM.