R
Roland Greve
Hi all,
Been working on this problem for several hours now but somehow I'm
overlooking something important and probably very obvious.
tblCPPT: Table with all past and future payments for different companies.
(PaymentDate, Amount, Currency, ExRate, Description, Category, CompanyFrom,
CompanyTo, PaymentNumber)
qryCompaniesConsIDNo: Query with company name(s) and matching company ID('s)
selected from a form with unbound checkboxes.
What I need is a query which selects those payments made by the selected
companies (tblCPPT.CompanyFrom) but excluding those payments made between
the selected companies (tblCPPT.CompanyTo); a consolidated payment plan for
the selected companies.
The SQL I have so far:
SELECT tblCPPT.*
FROM tblCPPT, qryCompaniesConsIDNo
WHERE (((tblCPPT.CompanyFrom)=[qryCompaniesConsIDNo]![CompanyID])
AND ((tblCPPT.CompanyTo)<>[qryCompaniesConsIDNo]![CompanyID]));
which selects the payments made by the selected companies allright, but
refuses to exclude those payments made between the selected companies. The
Data Types for both CompanyFrom and CompanyTo in tblCPPT are the same.
Hope this is clear.
Regards,
Roland
Been working on this problem for several hours now but somehow I'm
overlooking something important and probably very obvious.
tblCPPT: Table with all past and future payments for different companies.
(PaymentDate, Amount, Currency, ExRate, Description, Category, CompanyFrom,
CompanyTo, PaymentNumber)
qryCompaniesConsIDNo: Query with company name(s) and matching company ID('s)
selected from a form with unbound checkboxes.
What I need is a query which selects those payments made by the selected
companies (tblCPPT.CompanyFrom) but excluding those payments made between
the selected companies (tblCPPT.CompanyTo); a consolidated payment plan for
the selected companies.
The SQL I have so far:
SELECT tblCPPT.*
FROM tblCPPT, qryCompaniesConsIDNo
WHERE (((tblCPPT.CompanyFrom)=[qryCompaniesConsIDNo]![CompanyID])
AND ((tblCPPT.CompanyTo)<>[qryCompaniesConsIDNo]![CompanyID]));
which selects the payments made by the selected companies allright, but
refuses to exclude those payments made between the selected companies. The
Data Types for both CompanyFrom and CompanyTo in tblCPPT are the same.
Hope this is clear.
Regards,
Roland