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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|