Triple Join Uneditable in form

Drunkenneo

Registered User.
Local time
Tomorrow, 00:40
Joined
Jun 4, 2013
Messages
192
I have a query:

Code:
SELECT purchaseOrder.poId, purchaseOrder.poYear, purchaseOrder.poDate, purchaseOrder.userId, purchaseOrder.currencyId, purchaseOrder.poSendDate, partnerDetails.name
FROM purchaseOrder INNER JOIN (orderDetails INNER JOIN partnerDetails ON orderDetails.partnerDetailsId = partnerDetails.partnerDetailsId) ON Cstr(Format(purchaseOrder.poId,"00000")) = Nz(MID(orderDetails.poNo,6,5),"0");

Simple join query gives dup entries also, i need in single entry.
When using Distinct query for the form control source, the record is uneditable, can i get the records without dups.
 
Code:
SELECT purchaseOrder.poId
     , purchaseOrder.poYear
     , purchaseOrder.poDate
     , purchaseOrder.userId
     , purchaseOrder.currencyId
     , purchaseOrder.poSendDate
     , partnerDetails.name
FROM purchaseOrder 
INNER JOIN (orderDetails 
INNER JOIN partnerDetails     ON orderDetails.partnerDetailsId = partnerDetails.partnerDetailsId) 
                              ON Cstr(Format(purchaseOrder.poId,"00000")) = Nz(MID(orderDetails.poNo,6,5),"0");
I believe the functions in the join cause your query to become uneditable, not 100% on that though... Have you joined your tables on proper primary keys?

If your query returns duplicates that means that your records are not "unique".
Your joining both PartnerDetails and OrderDetails (which obviously lack the tbl prefix), the fact they are Details makes one expect the Purchase order to be duplicated/replicted for each of the details...
 

Users who are viewing this thread

Back
Top Bottom