Solved

Alias in Microsoft Query no longer recognized

Posted on 2013-01-09
5
1,020 Views
Last Modified: 2013-01-19
I have some Excel 2010 workbooks that connect to an Oracle database. Data is returned via Microsoft Query. The query contains some aliases. The data continues to be returned to the spreadsheet with no errors on update. However, if I try to edit the query, I get the following error message: ORA-923: FROM keyword not found where expected. I've discovered that if I delete the alias, I do not get the error.

At first I thought it had to do with upgrading to a new computer (Windows 7 64bit), but I've tested on older computers in the office and I get the same error.

The code follows:
SELECT AR_TRX_HEADER.SONO, AR_TRX_HEADER.INVOICEDATE, GA_BLOCK.ID, Sum(AR_TRX_PRODUCT.QNT) AS "SHIP", AR_TRX_CHARGE_VIEW.QNT AS "SOLD", Sum(AR_TRX_HEADER_AUX.QNT) AS "COUNT", Sum(AR_TRX_PRODUCT.QNT*AR_TRX_DETAIL.COSTPRICE) AS "REVENUE"
FROM COMPANY_1.AR_TRX_CHARGE_VIEW AR_TRX_CHARGE_VIEW, COMPANY_1.AR_TRX_DETAIL AR_TRX_DETAIL, COMPANY_1.AR_TRX_HEADER AR_TRX_HEADER, COMPANY_1.AR_TRX_HEADER_AUX AR_TRX_HEADER_AUX, COMPANY_1.AR_TRX_PRODUCT AR_TRX_PRODUCT, COMPANY_1.GA_BLOCK GA_BLOCK
WHERE AR_TRX_PRODUCT.ARTRXHDRIDX = AR_TRX_HEADER.ARTRXHDRIDX AND AR_TRX_DETAIL.ARTRXHDRIDX = AR_TRX_PRODUCT.ARTRXHDRIDX AND AR_TRX_DETAIL.ARTRXDTLSEQ = AR_TRX_PRODUCT.ARTRXDTLSEQ AND AR_TRX_HEADER_AUX.ARTRXHDRIDX = AR_TRX_PRODUCT.ARTRXHDRIDX AND AR_TRX_HEADER_AUX.ARTRXDTLSEQ = AR_TRX_DETAIL.ORIGINALSEQ AND GA_BLOCK.GABLOCKIDX = AR_TRX_PRODUCT.GABLOCKIDX AND AR_TRX_CHARGE_VIEW.ARTRXHDRIDX = AR_TRX_PRODUCT.ARTRXHDRIDX
GROUP BY AR_TRX_HEADER.SONO, AR_TRX_HEADER.INVOICEDATE, GA_BLOCK.ID, AR_TRX_CHARGE_VIEW.QNT, AR_TRX_DETAIL.GLDELETECODE, AR_TRX_HEADER_AUX.TAB, AR_TRX_HEADER.CUSTNAMEIDX, AR_TRX_CHARGE_VIEW.CHARGEMETHODTYPE, AR_TRX_CHARGE_VIEW.FCCHARGEIDX, AR_TRX_CHARGE_VIEW.LINENO, AR_TRX_PRODUCT.GABLOCKIDX
HAVING (AR_TRX_HEADER.INVOICEDATE>{ts '2012-01-01 00:00:00'} And AR_TRX_HEADER.INVOICEDATE<={ts '2012-12-31 00:00:00'}) AND (AR_TRX_DETAIL.GLDELETECODE='N') AND (AR_TRX_HEADER_AUX.TAB=2) AND (AR_TRX_HEADER.CUSTNAMEIDX=9) AND (AR_TRX_CHARGE_VIEW.CHARGEMETHODTYPE='1') AND (AR_TRX_CHARGE_VIEW.FCCHARGEIDX=17) AND (AR_TRX_CHARGE_VIEW.LINENO=1) AND (AR_TRX_PRODUCT.GABLOCKIDX<>128 And AR_TRX_PRODUCT.GABLOCKIDX<>127 And AR_TRX_PRODUCT.GABLOCKIDX<>135)
ORDER BY AR_TRX_HEADER.INVOICEDATE
0
Comment
Question by:clcarlson
  • 3
  • 2
5 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 38759594
Should the alias column names have quotes around them?
0
 

Author Comment

by:clcarlson
ID: 38759627
I've tried double quotes, single quotes, no quotes, no AS. Nothing seems to work any more. Originally the query had single quotes and no error. The issue began mid-December. I notice there were quite a few Office 2010 updates on 12-12-12.
0
 
LVL 23

Expert Comment

by:NBVC
ID: 38759851
I haven't played with MS Query in Excel 2010 yet, so not sure why it would bark at you.... hopefully someone with some experience can further assist...
0
 

Accepted Solution

by:
clcarlson earned 0 total points
ID: 38774833
Contacted Microsoft support. It was a known issue. It required an edit to the registry:
1. HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\query\options
2. After you select the subkey that is specified in step 1, point to New on the Edit menu, and then click DWORD Value.
3. Type AllowAlias, and then press ENTER.
4. Right-click AllowAlias, and then click Modify.
5. In the Value data box, type 2, and then click OK.
6. On the File menu, click Exit to exit Registry Editor.
0
 

Author Closing Comment

by:clcarlson
ID: 38796056
Because I found the solution myself by contacting Microsoft support.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dynamic Chart Range 13 36
MS excel check if Links exist 5 35
Locking down a pc/laptop 11 29
Excel highlight a cell based on input from another cell 3 14
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question