Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel XP removes AS part of statement

I am trying to help an individual with a MS Query.

In Excel 97 MS Query the script was written:

TO_CHAR(LABTRANS.STARTDATE, 'YYYY') AS YEAR

In Excel XP I can run an existing Query and it returns the data as
expected, but when I view the query it is:

TO_CHAR(LABTRANS.STARTDATE, 'YYYY') AS 'YEAR'

However if I try to create a new query using XP MS Query then the AS
YEAR or AS 'YEAR' will be removed by MS Query and my column header will
now be:

TO_CHAR(LABTRANS.STARTDATE, 'YYYY')

Here are my examples:

MS Excel 97 Query

SELECT LABTRANS.LABORCODE, LABTRANS.REGULARHRS, LABTRANS.OTHRS,
LABTRANS.OTSCALE, LABTRANS.STARTDATE, LABTRANS.TRANSTYPE,
VALUELIST.VALDESC,
TO_CHAR(LABTRANS.STARTDATE, 'YYYY') AS 'YEAR'
FROM MAXIMO.LABTRANS LABTRANS, MAXIMO.VALUELIST VALUELIST
WHERE LABTRANS.TRANSTYPE = VALUELIST.VALUE
AND (LABTRANS.TRANSTYPE IN (SELECT VALUE FROM VALUELIST WHERE LISTNAME
= 'LTTYPE' AND MAXVALUE = 'NON-WORK'))
AND LABTRANS.LABORCODE IN (SELECT LABORCODE FROM LABOR WHERE LABOR.TYPE
= 'CUPE' AND LABOR.CREWID IS NOT NULL AND LABOR.LA9 = 'N' AND
LABOR.LA16 = 'WW' OR LABORCODE = '210308') AND VALUELIST.MAXVALUE =
'NON-WORK' ORDER BY LABTRANS.STARTDATE

MS Excel XP Query

SELECT LABTRANS.LABORCODE, LABTRANS.REGULARHRS, LABTRANS.OTHRS,
LABTRANS.OTSCALE, LABTRANS.STARTDATE, LABTRANS.TRANSTYPE,
VALUELIST.VALDESC,
TO_CHAR(LABTRANS.STARTDATE, 'YYYY')
FROM MAXIMO.LABTRANS LABTRANS, MAXIMO.VALUELIST VALUELIST
WHERE LABTRANS.TRANSTYPE = VALUELIST.VALUE
AND (LABTRANS.TRANSTYPE IN (SELECT VALUE FROM VALUELIST WHERE LISTNAME
= 'LTTYPE' AND MAXVALUE = 'NON-WORK'))
AND LABTRANS.LABORCODE IN (SELECT LABORCODE FROM LABOR WHERE LABOR.TYPE
= 'CUPE' AND LABOR.CREWID IS NOT NULL AND LABOR.LA9 = 'N' AND
LABOR.LA16 = 'WW' OR LABORCODE = '210308') AND VALUELIST.MAXVALUE =
'NON-WORK' ORDER BY LABTRANS.STARTDATE

In Excel XP, no matter what I put in the AS part of the statement when
I execute the script it runs and removes the AS part from the
statement. This only happens when I run the script from MS Query, if I
stay in Excel and just refresh the data, then it works fine.

I did not have this problem in Excel 97.

Any suggestions?


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change cell background color as part of the If statement? Jim H Excel Worksheet Functions 2 September 23rd 09 11:58 PM
Can a Macro be run as part of an IF() statement WAJ Excel Worksheet Functions 1 October 5th 07 04:57 AM
how do I read this part of a vlookup statement !1:65536,12,FALSE TJPimpact Excel Discussion (Misc queries) 1 January 11th 07 09:03 PM
Can I create an IF statement that looks for part of a string of te Josh Craig Excel Worksheet Functions 2 June 19th 06 08:23 AM
Excel XP removes AS part of statement quaoar Excel Programming 0 November 25th 03 05:34 PM


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

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

About Us

"It's about Microsoft Excel"