Combining Queries (2)

A

AGOKP4

Hi,

Is it possible to combine these queries below to get a single one?

Thanks!!!

TRANSFORM Count([Screened Qry Mt Sinai].[Study ID]) AS [CountOfStudy ID]
SELECT [Screened Qry Mt Sinai].[Creatinine Group], Count([Screened Qry Mt
Sinai].[Creatinine Group]) AS [CountOfCreatinine Group], [Sex]
FROM [Screened Qry Mt Sinai]
GROUP BY [Screened Qry Mt Sinai].[Creatinine Group], [Sex]
PIVOT [Screened Qry Mt Sinai].Tenofovir;

TRANSFORM Count([Screened Qry Tufts].[Study ID]) AS [CountOfStudy ID]
SELECT [Screened Qry Tufts].[Creatinine Group], [Screened Qry Tufts].Sex,
Count([Screened Qry Tufts].[Creatinine Group]) AS [CountOfCreatinine Group]
FROM [Screened Qry Tufts]
GROUP BY [Screened Qry Tufts].[Creatinine Group], [Screened Qry Tufts].Sex
PIVOT [Screened Qry Tufts].Tenofovir;

TRANSFORM Count([Screened Qry UAB].[Study ID]) AS [CountOfStudy ID]
SELECT [Screened Qry UAB].[Creatinine Group], Count([Screened Qry
UAB].[Creatinine Group]) AS [CountOfCreatinine Group], [Sex]
FROM [Screened Qry UAB]
GROUP BY [Screened Qry UAB].[Creatinine Group], [Sex]
PIVOT [Screened Qry UAB].Tenofovir;
 
D

Duane Hookom

I see you posted the same question in the report's news group. It is much
better to post to only one group.

This was my suggestion there:
Create a union query of your individual select queries first:

SELECT [Study ID], [Creatinine Group], [Sex], Tenofovir
FROM [Screened Qry Mt Sinai]
UNION ALL
SELECT [Study ID], [Creatinine Group], [Sex], Tenofovir
FROM [Screened Qry Tufts]
UNION ALL
SELECT [Study ID], [Creatinine Group], [Sex], Tenofovir
FROM [Screened Qry UAB];

Then create a crosstab from the result.
 

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

Combine Queries (2) 6
Combining Queries 4
Combine Crosstab Queries? 2
Union Queries 1
Sorting data from different centers 10
Joining Crosstab queries 3
Report by group in columns 8
query too slow 1

Top