How can I combine two queries ? QoQ does not work
I have one query where I just count the total qty coming in per month, something like:
<cfquery name="qryIn" datasource="dbname">
select count(orderNO) as totalIN,month
where status = "IN"
group by month
</cfquery>
I then have a second query to count the total qty going out per month
<cfquery name="qryOut" datasource="dbname">
select count(orderNO) as totalOut,month
where status = "OUT"
group by month
</cfquery>
I then use QoQ to combine both:
<cfquery="qryTotal" dbtype="query">
select
totalIN,
totalOUT
from qryIN,qryOUT
where qryIN.month = qryOUT.month
</cfquery>
The problem I am running into is that QoQ does not allow LEFT JOIN, so that if the month is in one query but not the other, it will not pick up that record. And that is throwing off my counts.
How can I combine both queries, and bypass QoQ to get a qty IN and qty Out value, per month ? and, for example, if qty in exists for one month and qty Out does not exists for that month, then qty Out will be zero for that month.
I need this data to plot a chart.
Thanks for any help provided.
