joining crosstab queries

T

TBA

I read in one post that joining crosstab queries using UNION may be a
redundant idea- but I'm afraid it was a little above my level!
If anyone can offer help here, i'd be most grateful.
I have two crosstab queries extracting different scores from patients across
time. As there are more than one type of score I am assuming I need a query
for each. I would like to combine these so that i can export as an excel file.
using UNION (removing semicolon from first query) didn't work.
Here are the two queries:

queryQOL1:
TRANSFORM First([Quality of Life].[Visual Analogue Scale]) AS [FirstOfVisual
Analogue Scale]
SELECT [Quality of Life].NHI
FROM Patient INNER JOIN [Quality of Life] ON Patient.NHI=[Quality of Life].NHI
GROUP BY [Quality of Life].NHI
PIVOT [Quality of Life].[Review Type];

queryQOL2:
TRANSFORM First([Quality of Life].[EQ5D - VAS]) AS [FirstOfEQ5D - VAS]
SELECT [Quality of Life].NHI
FROM Patient INNER JOIN [Quality of Life] ON Patient.NHI = [Quality of
Life].NHI
GROUP BY [Quality of Life].NHI
ORDER BY [Quality of Life].[Review Type] DESC
PIVOT [Quality of Life].[Review Type];
 
D

Duane Hookom

You can't combine UNION and TRANSFORM in the same query. You could save the
queries and then use a third query to UNION the two crosstabs. This assumes
the crosstabs will each return the same number of columns.

You can get a crosstab to return more than one value using the solution
found at http://www.tek-tips.com/faqs.cfm?fid=4524
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

query needs to run twice to work 2
Union Query 3
Crosstab query error 3104 11
2 Identical queries, 1 works...... 3
Query within date range 1
Combining Crosstab Queries 1
Union Queries 1
CrossTab Query question 1

Top