1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| SELECT
PO.Subject,
PO.DateDoc,
PO.GrandTotal
FROM
CMP inner join PQ on (CMP.CT_Z=PQ.CT_B) AND (CMP.CR_Z=PQ.CR_B)
inner join PO on (PQ.CT_A=PO.CT_E) AND (PQ.CR_A=PO.CR_E)
WHERE
((CMP.CT_Z='CMP') AND (CMP.CompanyName='COMPUCOM'))
AND
(((PO.CT_PO='PO') AND (PO.DateDoc>='2010.10.01')) AND ((PO.CT_PO='PO') AND (PO.DateDoc<='2010.12.31')))
UNION
SELECT
PO.Subject,
PO.DateDoc,
PO.GrandTotal
FROM
CMP inner join CO on (CMP.CT_Z=CO.CT_B) AND (CMP.CR_Z=CO.CR_B)
inner join PO on (CO.CT_A=PO.CT_E) AND (CO.CR_A=PO.CR_E)
WHERE
((CMP.CT_Z='CMP') AND (CMP.CompanyName='COMPUCOM'))
AND
(((PO.CT_PO='PO') AND (PO.DateDoc>='2010.10.01')) AND ((PO.CT_PO='PO') AND (PO.DateDoc<='2010.12.31'))) |
Partager