N
Nick O
Trying to query on a subquery.
Text works fine but when I return to it, the query designer
tries replace the parentheses () with [] around the subquery and sticks a
'.' after the ']'. A variant is it creates a bizarre alias e.g.
[%$##@_Alias] after the subquery.
Example:
SELECT *
FROM (SELECT [3a].Period, [3a].Origin, [3a].[Destination Region],
[3a].route, [3a].['Dest Regn Count'], [3b].seats, [3b].flights
FROM 3a INNER JOIN 3b ON ([3a].Period=[3b].Period) AND
([3a].Origin=[3b].Origin) AND ([3a].[Destination Region]=[3b].[Destination
Region]) AND ([3a].route=[3b].route)
UNION ALL select '' as period, '' as origin, q.data as [destination region],
'' as route, 0 as ['Dest Regn Count'], 0 as seats, 0 as flights from
[~padvalues] q
where q.fieldname="Region");
which runs fine, becomes:
SELECT *
FROM [SELECT [3a].Period, [3a].Origin, [3a].[Destination Region],
[3a].route, [3a].['Dest Regn Count'], [3b].seats, [3b].flights
FROM 3a INNER JOIN 3b ON ([3a].Period=[3b].Period) AND
([3a].Origin=[3b].Origin) AND ([3a].[Destination Region]=[3b].[Destination
Region]) AND ([3a].route=[3b].route)
UNION ALL select '' as period, '' as origin, q.data as [destination region],
'' as route, 0 as ['Dest Regn Count'], 0 as seats, 0 as flights from
[~padvalues] q
where q.fieldname="Region"]. AS [%$##@_Alias];
when reloaded.
Any ideas - it's driving me nuts!
Text works fine but when I return to it, the query designer
tries replace the parentheses () with [] around the subquery and sticks a
'.' after the ']'. A variant is it creates a bizarre alias e.g.
[%$##@_Alias] after the subquery.
Example:
SELECT *
FROM (SELECT [3a].Period, [3a].Origin, [3a].[Destination Region],
[3a].route, [3a].['Dest Regn Count'], [3b].seats, [3b].flights
FROM 3a INNER JOIN 3b ON ([3a].Period=[3b].Period) AND
([3a].Origin=[3b].Origin) AND ([3a].[Destination Region]=[3b].[Destination
Region]) AND ([3a].route=[3b].route)
UNION ALL select '' as period, '' as origin, q.data as [destination region],
'' as route, 0 as ['Dest Regn Count'], 0 as seats, 0 as flights from
[~padvalues] q
where q.fieldname="Region");
which runs fine, becomes:
SELECT *
FROM [SELECT [3a].Period, [3a].Origin, [3a].[Destination Region],
[3a].route, [3a].['Dest Regn Count'], [3b].seats, [3b].flights
FROM 3a INNER JOIN 3b ON ([3a].Period=[3b].Period) AND
([3a].Origin=[3b].Origin) AND ([3a].[Destination Region]=[3b].[Destination
Region]) AND ([3a].route=[3b].route)
UNION ALL select '' as period, '' as origin, q.data as [destination region],
'' as route, 0 as ['Dest Regn Count'], 0 as seats, 0 as flights from
[~padvalues] q
where q.fieldname="Region"]. AS [%$##@_Alias];
when reloaded.
Any ideas - it's driving me nuts!