LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Excel 2003, Microsoft Query - reference to subquery alias

Hi, I have problem with MS Query in Excel 2003.
I'm trying to get information from MySQL database to Excel with an
SQL-clause that contains a few subqueries. For example, the following
SQL-clause gives me an error saying: "Unknown column hours.hourssum in 'field
list'"

Query:
SELECT orders.id AS id,
hours.hourssum AS hourssum
FROM
orders LEFT JOIN
(SELECT job.id AS id, sum(job.hours1) AS hourssum FROM job GROUP BY job.id)
AS hours ON orders.id=hours.id
WHERE orders.id = '123';

I know that the query above can be done a bit differently, but it's just an
example of the problem I have. The problem is that MS Query can't see the
table alias "hours" and gives me a complaint that it doesn't exist. Same
SQL-clause works fine in MySQL Query Browser.

Is there a way around this, maybe a different syntax in SQL-caluse or
something else?
 
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
Query from microsoft query- Excel 2007 טבלאות אקסל 2007 Excel Discussion (Misc queries) 0 December 24th 07 10:47 PM
Importing Outlook Alias into an Excel 2003 macro fidgitthedigit Excel Discussion (Misc queries) 0 May 29th 06 02:24 PM
SQL query removes alias BusterC Excel Discussion (Misc queries) 1 February 8th 06 04:35 PM
Microsoft Excel Viewer 2003 won't open Microsoft Excel Worksheet Graham Jones Excel Discussion (Misc queries) 1 May 13th 05 12:58 AM
MS Query - Alias syntax David P Excel Worksheet Functions 3 February 16th 05 09:29 AM


All times are GMT +1. The time now is 07:44 AM.

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"