troubleshooting Question

Combining cfqueries with cfoutput

Avatar of ethanjohnsons
ethanjohnsons asked on
Web Servers
16 Comments3 Solutions351 ViewsLast Modified:
<cfquery name="q1", ....>
select VOLDEPT, count (VOLDEPT) as deptCount
from VolunteerDemo
group by VOLDEPT
order by VOLDEPT
</cfquery>

<cfquery name="q2", ....>
select VOLDEPT, count (VOLINFLUENZA) as fluCount
from VolunteerDemo d, VolunteerMedical m
where d.VOLID = m.VOLID
      and VOLINFLUENZA between '01/01/2001' and '10/01/2006'
group by VOLDEPT
order by VOLDEPT
</cfquery>

What I want is: the count of dept (from q1) and then count of the flu (from q2).

so, it gives, i.e.

VOLDEPT  q1.deptCount    q2.fluCount
BER-PD                   5              1
BLOSSOM SPOT      4              4
BPK-FD                   20             1
CONTRACT             12             0   ==> this is where the count of dept exists, but no flu count exists.
bla...

thx
ASKER CERTIFIED SOLUTION
danrosenthal

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros