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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Querying using SQL statement
Hi
Using an expression as follows... SELECT IDCustomer AS Code, Name, Address FROM Customers ....the AS clause doesn't work in Access 2007. Running the query, the column caption remains IDCustomer. What is the problem? Why this happens? Is there any solution (except back to 2003)? Thanks in advance for your help. Joe |
#2
|
|||
|
|||
Querying using SQL statement
On Sun, 7 Feb 2010 20:31:19 -0200, "Joe" wrote:
Hi Using an expression as follows... SELECT IDCustomer AS Code, Name, Address FROM Customers ...the AS clause doesn't work in Access 2007. Running the query, the column caption remains IDCustomer. What is the problem? Why this happens? Is there any solution (except back to 2003)? Thanks in advance for your help. Joe This is probably another reserved name. 2007 is much pickier about using reserved words (Code, Date, Order, etc.) as fieldnames. Does it work if you use AS CustomerCode? Or you might try AS [code] -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Querying using SQL statement
Hi John
The name Code was just an example. Anything I type, a regular text or even a name - Robert - for example, it doesn't work. I'm using a Access 2007 in Brazilian-portuguese version. This customized version could be the problem? In positive case, is there a solution? Thanks in advance for your time and answer. Joe "John W. Vinson" escreveu na mensagem ... On Sun, 7 Feb 2010 20:31:19 -0200, "Joe" wrote: Hi Using an expression as follows... SELECT IDCustomer AS Code, Name, Address FROM Customers ...the AS clause doesn't work in Access 2007. Running the query, the column caption remains IDCustomer. What is the problem? Why this happens? Is there any solution (except back to 2003)? Thanks in advance for your help. Joe This is probably another reserved name. 2007 is much pickier about using reserved words (Code, Date, Order, etc.) as fieldnames. Does it work if you use AS CustomerCode? Or you might try AS [code] -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Querying using SQL statement
On Sun, 7 Feb 2010 22:02:08 -0200, "Joe" wrote:
Hi John The name Code was just an example. Anything I type, a regular text or even a name - Robert - for example, it doesn't work. I'm using a Access 2007 in Brazilian-portuguese version. This customized version could be the problem? In positive case, is there a solution? Thanks in advance for your time and answer. Odd! I have a database with a ton of queries, many of which use aliases, and they work fine in 2007. Try leaving out the keyword AS - it's optional in at least some contexts. Perhaps you could post the actual complete SQL that's giving you the error. -- John W. Vinson [MVP] |
#5
|
|||
|
|||
Querying using SQL statement
Do you have a Caption property defined in the table design?
-- Duane Hookom Microsoft Access MVP "Joe" wrote: Hi John The name Code was just an example. Anything I type, a regular text or even a name - Robert - for example, it doesn't work. I'm using a Access 2007 in Brazilian-portuguese version. This customized version could be the problem? In positive case, is there a solution? Thanks in advance for your time and answer. Joe "John W. Vinson" escreveu na mensagem ... On Sun, 7 Feb 2010 20:31:19 -0200, "Joe" wrote: Hi Using an expression as follows... SELECT IDCustomer AS Code, Name, Address FROM Customers ...the AS clause doesn't work in Access 2007. Running the query, the column caption remains IDCustomer. What is the problem? Why this happens? Is there any solution (except back to 2003)? Thanks in advance for your help. Joe This is probably another reserved name. 2007 is much pickier about using reserved words (Code, Date, Order, etc.) as fieldnames. Does it work if you use AS CustomerCode? Or you might try AS [code] -- John W. Vinson [MVP] . |
#6
|
|||
|
|||
Querying using SQL statement
I can't say this is happening and can't test to see if this behavior is
different in 2007 versus 2003. I would check that there is no Caption property set for the fields. Access tends to display that as a column header (name) when you are displaying the results of a query in datasheet view. Besides checking the fields in the tables, check the caption property of the fields in the query if you are using query design view. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Joe wrote: Hi John The name Code was just an example. Anything I type, a regular text or even a name - Robert - for example, it doesn't work. I'm using a Access 2007 in Brazilian-portuguese version. This customized version could be the problem? In positive case, is there a solution? Thanks in advance for your time and answer. Joe "John W. Vinson" escreveu na mensagem ... On Sun, 7 Feb 2010 20:31:19 -0200, "Joe" wrote: Hi Using an expression as follows... SELECT IDCustomer AS Code, Name, Address FROM Customers ...the AS clause doesn't work in Access 2007. Running the query, the column caption remains IDCustomer. What is the problem? Why this happens? Is there any solution (except back to 2003)? Thanks in advance for your help. Joe This is probably another reserved name. 2007 is much pickier about using reserved words (Code, Date, Order, etc.) as fieldnames. Does it work if you use AS CustomerCode? Or you might try AS [code] -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|