Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default ms query xp issue


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.ExcelTip.com/
~~View and post usenet messages directly 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
Wen Query Issue Hans Excel Discussion (Misc queries) 6 December 11th 08 07:39 PM
Web Query Formatting Issue... Jambruins Excel Discussion (Misc queries) 0 June 28th 07 04:00 PM
Need help with an 'Edit Query' issue. ken.kimbrell Excel Discussion (Misc queries) 2 May 8th 06 08:48 PM
Query and/or 3D Referencing Issue BonnieRone Excel Discussion (Misc queries) 0 January 6th 06 06:01 PM
Chart & ms Query issue michanne Excel Programming 0 November 5th 03 06:55 PM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"