A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Alias outfield column header



 
 
Thread Tools Display Modes
  #1  
Old November 18th, 2009, 12:33 AM posted to microsoft.public.access.queries
PatK
external usenet poster
 
Posts: 111
Default Alias outfield column header

I have a question about Aliasing fields in a query, if that it the right
terminology.

I have linked my Access DB to an external sharepoint list. The person who
created it labeled the heading of one column: Prod (start month).

I am creating a query and while I am at it, I want to simply this name, to
Sdate. So, I have entered this in the field column for this field: Sdate:
Prod (start month)

Unfortunately, while it gives no error, the output column is still labelled
Prod (start month). When I look at the sql query, I see:

SELECT DISTINCTROW ... [DB Upgrades Funnel].[Prod (Month Start)] AS SDate, ...

SO this is as I would expect, but the output table heading is not Sdate, as
I would hope. Ideas? ARe those parentheses in the table header row of the
source list confounding the situation?

Many THanks!

Patk

  #2  
Old November 18th, 2009, 12:51 AM posted to microsoft.public.access.queries
Bob Barrows
external usenet poster
 
Posts: 475
Default Alias outfield column header

PatK wrote:
I have a question about Aliasing fields in a query, if that it the
right terminology.

I have linked my Access DB to an external sharepoint list. The
person who created it labeled the heading of one column: Prod (start
month).

I am creating a query and while I am at it, I want to simply this
name, to Sdate. So, I have entered this in the field column for this
field: Sdate: Prod (start month)

Unfortunately, while it gives no error, the output column is still
labelled Prod (start month). When I look at the sql query, I see:

SELECT DISTINCTROW ... [DB Upgrades Funnel].[Prod (Month Start)] AS
SDate, ...

SO this is as I would expect, but the output table heading is not
Sdate, as
I would hope. Ideas? ARe those parentheses in the table header row
of the source list confounding the situation?

That is puzzling. i think we need to see the complete sql.

In the meantime: you should evaluate whether you really need that
DISTINCTROW instead of DISTINCT. It is usually used to make a query
updatable that would otherwise be non-updatable if DISTINCT were used.
Here is what online help has to say:

DISTINCTROW has an effect only when you select fields from some, but not
all, of the tables used in the query. DISTINCTROW is ignored if your query
includes only one table, or if you output fields from all tables.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #3  
Old November 18th, 2009, 12:22 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Alias outfield column header

You might try making the field a calculated field if that doesn't cause you
problems elsewhere.

DateAdd("D",0,[DB Upgrades Funnel].[Prod (Month Start)]) AS SDate

If you are looking at this in Data Sheet view Access has the nasty behavior
(in my opinion) of showing the CAPTION property as the column name. It will
even grab the caption from the field property of the table if one is assigned
there and not in the query.

I don't know that this work the same way with Sharepoint, but I would guess
that it may.

On the other hand if you are using this query as the source for a form or
report you will need to refer to the field by the alias. Since my
applications avoid users seeing queries directly the caption issue is
generally not a problem for me.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

PatK wrote:
I have a question about Aliasing fields in a query, if that it the right
terminology.

I have linked my Access DB to an external sharepoint list. The person who
created it labeled the heading of one column: Prod (start month).

I am creating a query and while I am at it, I want to simply this name, to
Sdate. So, I have entered this in the field column for this field: Sdate:
Prod (start month)

Unfortunately, while it gives no error, the output column is still labelled
Prod (start month). When I look at the sql query, I see:

SELECT DISTINCTROW ... [DB Upgrades Funnel].[Prod (Month Start)] AS SDate, ...

SO this is as I would expect, but the output table heading is not Sdate, as
I would hope. Ideas? ARe those parentheses in the table header row of the
source list confounding the situation?

Many THanks!

Patk

  #4  
Old November 19th, 2009, 06:51 PM posted to microsoft.public.access.queries
PatK
external usenet poster
 
Posts: 111
Default Alias outfield column header

Had an issue for a couple days, and could not see replies (nor am I getting
emails that replies were posted) so sorry for delay. Bottom line, since I
thought this had not been posted, I reposted last eve, the part about the
aliasing. See:

https://www.microsoft.com/office/com...xp=&sloc=en-us

The solution suggested there, worked. Ie, going to design view of the query,
right clicking on the field and changing the Caption to what I want. It
worked. Unexplainable. Wonder if it is due to something with Sharepoint
(and my not having read-access to the source list? ) Voodoo. Appreciate
your response!

PatK

"Bob Barrows" wrote:

PatK wrote:
I have a question about Aliasing fields in a query, if that it the
right terminology.

I have linked my Access DB to an external sharepoint list. The
person who created it labeled the heading of one column: Prod (start
month).

I am creating a query and while I am at it, I want to simply this
name, to Sdate. So, I have entered this in the field column for this
field: Sdate: Prod (start month)

Unfortunately, while it gives no error, the output column is still
labelled Prod (start month). When I look at the sql query, I see:

SELECT DISTINCTROW ... [DB Upgrades Funnel].[Prod (Month Start)] AS
SDate, ...

SO this is as I would expect, but the output table heading is not
Sdate, as
I would hope. Ideas? ARe those parentheses in the table header row
of the source list confounding the situation?

That is puzzling. i think we need to see the complete sql.

In the meantime: you should evaluate whether you really need that
DISTINCTROW instead of DISTINCT. It is usually used to make a query
updatable that would otherwise be non-updatable if DISTINCT were used.
Here is what online help has to say:

DISTINCTROW has an effect only when you select fields from some, but not
all, of the tables used in the query. DISTINCTROW is ignored if your query
includes only one table, or if you output fields from all tables.


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:08 PM.


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