A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combine Crosstab Queries?



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2009, 09:04 PM posted to microsoft.public.access.queries
AGOKP4
external usenet poster
 
Posts: 51
Default Combine Crosstab Queries?

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;

  #2  
Old July 8th, 2009, 11:08 PM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Combine Crosstab Queries?

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" wrote:

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;

  #3  
Old July 9th, 2009, 02:13 PM posted to microsoft.public.access.queries
AGOKP4
external usenet poster
 
Posts: 51
Default Combine Crosstab Queries?

Thanks Duane,

How do I do the final select query?

"Duane Hookom" wrote:

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" wrote:

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;

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:44 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.