Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Microsoft Query - reference to subquery alias
Hi
I'm having problems creating queries to MySQL database with MS Query. For example the following 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 = '981382'; gives me an error: "Unknown column hours.hourssum in 'field list'". Same query works in MySQL Query Browser just fine. I know that the query can be done a bit differently so it works in MS Query, but this query is just an example of the problem I'm having. The problem is that MS Query doesn't doesn't recognize the subquery alias "hours". Is there a way around this problem or does MS Query have some kind of special syntax for these situations? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003, Microsoft Query - reference to subquery alias | Excel Discussion (Misc queries) | |||
SQL query removes alias | Excel Discussion (Misc queries) | |||
MS Query - Alias syntax | Excel Worksheet Functions | |||
Column Alias in MS Query | Excel Programming | |||
Microsoft Query - how to reference a cell value in a filter | Excel Programming |