March 22, 2005 at 8:09 pm
Does anybody know why, Microsoft Query under windows XP fails to recognise the "AS" alias within the sql statement.
Im renaming fields so that when I export the result set to excel in a pivot table, I simply drag and drop the field name, (however my coding is showing up as the field name instead)
Microsoft Query is ignoring my AS Statement
For example:
select c.client_no,
decode(c.given_names,null,c.agency_name_surname||decode(c.section,null,'',', '||c.section),ltrim(c.title||' '||c.given_names||' '||c.agency_name_surname)) as Client_Name
from clients c
where c.parent_client = 'CLC'
or c.agency_name_surname like ('%COMMUNITY%')
order by c.client_no;
Therefore my field name with the pivot table is showing up as:
decode(c.given_names,null,c.agency_name_surname||decode(c.section,null,'',', '||c.section),ltrim(c.title||' '||c.given_names||' '||c.agency_name_surname))
March 23, 2005 at 5:01 am
Have you tried encapsulating the AS in [] or '' i.e. [Client_Name] or 'Client_Name'?
Good Hunting!
AJ Ahrens
webmaster@kritter.net
March 23, 2005 at 3:10 pm
select c.client_no,
Client_Name = decode(c.given_names,null,c.agency_name_surname||decode(c.section,null,'',', '||c.section),ltrim(c.title||' '||c.given_names||' '||c.agency_name_surname))
from clients c
where c.parent_client = 'CLC'
or c.agency_name_surname like ('%COMMUNITY%')
order by c.client_no;
The excel I last used 6 months ago did not support as alias, but did support alias =
Tim S
March 23, 2005 at 4:01 pm
Thanks guys for your suggestions, however it is still not working. I dont know if it is an install issue or not!
We have recently migrated to Windows XP and were previously on Windows NT where the problem didnt exist.
For example:
The simple SQL statement below yields the following Error. However if I put a ; at the end of the script, it runs and doesn't produce an error, but it drops the alias.
March 24, 2005 at 8:20 am
is DECODE an Oracle command? should you not be using CASE ? OR am I missing something obvious?
Dave J
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy