Combine Crosstab Queries?

A

AGOKP4

Hi,

I'm trying to combine 3 crosstab queries, the SQL statements are below and
get a report out of it. Is it possible to do it this way or try something
else?

Thanks

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

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

TRANSFORM Count([Enrolled F Qry].Tenofovir) AS CountOfTenofovir
SELECT [Enrolled F Qry].[Creatinine Group], Count([Enrolled F
Qry].[Creatinine Group]) AS [CountOfCreatinine Group]
FROM [Enrolled F Qry]
GROUP BY [Enrolled F Qry].[Creatinine Group]
PIVOT [Enrolled F Qry].Tenofovir;
 
D

Duane Hookom

Since the source queries aren't the same, I think your simplest solution is
to combine the crosstabs in a final select query.
 
A

AGOKP4

Thanks Duane,

How do I do the final select query?

Duane Hookom said:
Since the source queries aren't the same, I think your simplest solution is
to combine the crosstabs in a final select query.
--
Duane Hookom
Microsoft Access MVP


AGOKP4 said:
Hi,

I'm trying to combine 3 crosstab queries, the SQL statements are below and
get a report out of it. Is it possible to do it this way or try something
else?

Thanks

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

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

TRANSFORM Count([Enrolled F Qry].Tenofovir) AS CountOfTenofovir
SELECT [Enrolled F Qry].[Creatinine Group], Count([Enrolled F
Qry].[Creatinine Group]) AS [CountOfCreatinine Group]
FROM [Enrolled F Qry]
GROUP BY [Enrolled F Qry].[Creatinine Group]
PIVOT [Enrolled F Qry].Tenofovir;
 

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

Combining Queries 4
Union Queries 1
Combining Queries (2) 1
Joining Crosstab queries 3
Combine Queries (2) 6
Report by group in columns 8
query very slow 5
query too slow 1

Top