H
HartJF
I have created a crosstab that uses a subquery as its source and contains a
PIVOT... IN clause, which executes successfully. I have a query that selects
certain records from that crosstab and performs calculations on its fields,
but it fails with a "Syntax error in FROM clause," highlighting the TRANSFORM
verb. I tried simplifying the select query wrapper, as SELECT * FROM
([crosstab query]);, which fails with the same message. Could the subquery
be so complex that it frustrates the query optimizer? (The subquery JOINs
two tables and LEFT JOINs a third, and selects records based on hard-coded
dates. The production version will be a temporary, dynamically-created query
in VBA.) Must I convert the subquery to a make-(temporary)table query and
use that table as input to the crosstab? If I must make a temporary table,
I'd prefer to store the results of the crosstab, but if I can't SELECT *, I
don't expect to be able to SELECT INTO. I don't understand how the crosstab
can run by itself, but fails when embedded.
PIVOT... IN clause, which executes successfully. I have a query that selects
certain records from that crosstab and performs calculations on its fields,
but it fails with a "Syntax error in FROM clause," highlighting the TRANSFORM
verb. I tried simplifying the select query wrapper, as SELECT * FROM
([crosstab query]);, which fails with the same message. Could the subquery
be so complex that it frustrates the query optimizer? (The subquery JOINs
two tables and LEFT JOINs a third, and selects records based on hard-coded
dates. The production version will be a temporary, dynamically-created query
in VBA.) Must I convert the subquery to a make-(temporary)table query and
use that table as input to the crosstab? If I must make a temporary table,
I'd prefer to store the results of the crosstab, but if I can't SELECT *, I
don't expect to be able to SELECT INTO. I don't understand how the crosstab
can run by itself, but fails when embedded.