QryFieldTotals below gives all records that have [SOType]=kdb and [Status]=Is Null.
QryOrderForecasts below gives all records with [OrderComplete]=0 and includes the [SchedShipDate] and [SchedShipQty]
The problem is that a record, which is an order, consist of [FSONO] and [SeqNo]. It can have one or multiple [SEQNO]--(Example: 123456-01, 123456-02, 123456-03......)
Separately these queries work beautifully. Combined the records are quadrupled and different [SchedShipDate] are assigned to all records.
Does anyone have any solutions/suggestions as to how I can combine the queries without quadruple records?????????????????????????
QryFieldTotals
--------------
SELECT somnew.SOTYPE, sotrnew.STATUS, somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO, Sum(sotrnew.FAMOUNT) AS TotalOrderAmount, Sum(sotrnew.FORDQTY) AS TotalQtyOrdered, sotrnew.FPRICE, somnew.FCOMPANY, somnew.FPONO, Sum(sotrnew.FSHIPQTY) AS TotalDiesShipped, sotrnew.FITEMNO, sotrnew.FDUEDATE, somnew.FORDDATE
FROM somnew INNER JOIN sotrnew ON somnew.FSONO = sotrnew.FSONO
GROUP BY somnew.SOTYPE, sotrnew.STATUS, somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO, sotrnew.FPRICE, somnew.FCOMPANY, somnew.FPONO, sotrnew.FITEMNO, sotrnew.FDUEDATE, somnew.FORDDATE
HAVING (((somnew.SOTYPE)="kdb") AND ((sotrnew.STATUS) Is Null))
ORDER BY somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO;
QryOrderForecasts
------------------
SELECT tblOrderForecasts.OrderComplete, tblOrderForecasts.FSONO, tblOrderForecasts.SeqNO, tblOrderForecasts.SchedShipDate, tblOrderForecasts.SchedShipQty
FROM tblOrderForecasts
WHERE (((tblOrderForecasts.OrderComplete)=0))
ORDER BY tblOrderForecasts.SchedShipDate;
QryOrderForecasts below gives all records with [OrderComplete]=0 and includes the [SchedShipDate] and [SchedShipQty]
The problem is that a record, which is an order, consist of [FSONO] and [SeqNo]. It can have one or multiple [SEQNO]--(Example: 123456-01, 123456-02, 123456-03......)
Separately these queries work beautifully. Combined the records are quadrupled and different [SchedShipDate] are assigned to all records.
Does anyone have any solutions/suggestions as to how I can combine the queries without quadruple records?????????????????????????
QryFieldTotals
--------------
SELECT somnew.SOTYPE, sotrnew.STATUS, somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO, Sum(sotrnew.FAMOUNT) AS TotalOrderAmount, Sum(sotrnew.FORDQTY) AS TotalQtyOrdered, sotrnew.FPRICE, somnew.FCOMPANY, somnew.FPONO, Sum(sotrnew.FSHIPQTY) AS TotalDiesShipped, sotrnew.FITEMNO, sotrnew.FDUEDATE, somnew.FORDDATE
FROM somnew INNER JOIN sotrnew ON somnew.FSONO = sotrnew.FSONO
GROUP BY somnew.SOTYPE, sotrnew.STATUS, somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO, sotrnew.FPRICE, somnew.FCOMPANY, somnew.FPONO, sotrnew.FITEMNO, sotrnew.FDUEDATE, somnew.FORDDATE
HAVING (((somnew.SOTYPE)="kdb") AND ((sotrnew.STATUS) Is Null))
ORDER BY somnew.FCUSTNO, sotrnew.FSONO, sotrnew.SEQNO;
QryOrderForecasts
------------------
SELECT tblOrderForecasts.OrderComplete, tblOrderForecasts.FSONO, tblOrderForecasts.SeqNO, tblOrderForecasts.SchedShipDate, tblOrderForecasts.SchedShipQty
FROM tblOrderForecasts
WHERE (((tblOrderForecasts.OrderComplete)=0))
ORDER BY tblOrderForecasts.SchedShipDate;