I need your assistance combining the two queries below.
I need to take the sum of query #1 and subtract the sum of query #2 from it.
How can I do this? I have listed both my queries below.
The PONUMBER field in query 1 matches the PONUMBER field in query #2.
FROM POPHEADER as I
inner join POPDETAIL as P
on I.PONUMBER = P.PONUMBER
where I.[POLNESTA] not in (4,5,6) and P.[DOCDATE] >= '1/1/2014' and I.[ITEMNMBR] = '209822011'
and I.POTYPE =1
SELECT SUM(QTYRECVD) AS QTY
where [DATERECD] >= '1/1/2014' and RCPTSOLD = 0
and [PONUMBER] = '07277' and [ITEMNMBR] = '209822011'
Thanks in advance,