View Single Post
  #1  
Old May 27th, 2010, 09:25 PM posted to microsoft.public.access.queries
dtoney
external usenet poster
 
Posts: 65
Default How to Union Crosstabs...

I've been reading many posts but still trying to comprehend the union of
crosstab queries. I need to take the weekly count of estimates that take
under 4 days to be returned to the customer which I've calculated in the
Under4Days crosstab and divide by Total Count by Week for a %toTotal by week.
Here is the SQL for the two queries I need to combine.
Also, when crosstabing, I noticed one of my 5 customers don't show any data
for a week because the days taken were less than 4 that week. Is there a way
to get results for each week even when the customer falls below the 4 day
period?

# 1
qryEstOperStats_Timely_Est_Diff_under4days_Count

TRANSFORM
Val(Nz(Count(qryEstOperStats_Timely_Est_Diff_under 4days.WORK_REQ_NO),0)) AS
CountOfWORK_REQ_NO
SELECT qryEstOperStats_Timely_Est_Diff_under4days.AREA,
Val(Nz(Count(qryEstOperStats_Timely_Est_Diff_under 4days.WORK_REQ_NO),0)) AS
[Total Of WORK_REQ_NO]
FROM qryEstOperStats_Timely_Est_Diff_under4days
GROUP BY qryEstOperStats_Timely_Est_Diff_under4days.AREA
PIVOT Format([Week],"YYYY/MM/DD");

# 2
qryEstOperStats_Timely_Est_Diff_Count

TRANSFORM
Round(Val(Nz(Count(qryEstOperStats_Timely_Est_Diff .WORK_REQ_NO),0)),0) AS
CountOfWORK_REQ_NO
SELECT qryEstOperStats_Timely_Est_Diff.AREA,
Round(Val(Nz(Count(qryEstOperStats_Timely_Est_Diff .WORK_REQ_NO),0)),0) AS
[Total Of WORK_REQ_NO]
FROM qryEstOperStats_Timely_Est_Diff
GROUP BY qryEstOperStats_Timely_Est_Diff.AREA
PIVOT Format([Week],"YYYY/MM/DD");

any help is appreciated!