P
PEGPgrm
I have a query based on two tables joined (inner join) by a text field
"Invoice" and a text field "Vendor". When I look at the results, I am
getting extra records because the query is not returning exact matches on the
invoice field. For example, the query is returning invoice "050205" from the
first table joined to Invoice "50205" in the second table. I don't
understand how the query is seeing this as an exact match. The tables are
Pervasive Data tables linked using the Timberline ODBC driver. Does anyone
know a work around? (When completed, this query will be a union query
combining 5 related tables from 6 data sources, so I really need the exact
match to work inside this query.)
Here's the SQL statement:
SELECT "ALD" AS DataFolder, MASTER_APM_INVOICEAld.Vendor,
MASTER_APM_DISTRIBUTIONAld.Invoice, MASTER_APM_INVOICEAld.Accounting_Date,
MASTER_APM_DISTRIBUTIONAld.Status, MASTER_APM_DISTRIBUTIONAld.Description,
MASTER_APM_DISTRIBUTIONAld.Expense_Account, MASTER_APM_DISTRIBUTIONAld.Amount
FROM MASTER_APM_INVOICEAld INNER JOIN MASTER_APM_DISTRIBUTIONAld ON
(MASTER_APM_INVOICEAld.Invoice = MASTER_APM_DISTRIBUTIONAld.Invoice) AND
(MASTER_APM_INVOICEAld.Vendor = MASTER_APM_DISTRIBUTIONAld.Vendor);
"Invoice" and a text field "Vendor". When I look at the results, I am
getting extra records because the query is not returning exact matches on the
invoice field. For example, the query is returning invoice "050205" from the
first table joined to Invoice "50205" in the second table. I don't
understand how the query is seeing this as an exact match. The tables are
Pervasive Data tables linked using the Timberline ODBC driver. Does anyone
know a work around? (When completed, this query will be a union query
combining 5 related tables from 6 data sources, so I really need the exact
match to work inside this query.)
Here's the SQL statement:
SELECT "ALD" AS DataFolder, MASTER_APM_INVOICEAld.Vendor,
MASTER_APM_DISTRIBUTIONAld.Invoice, MASTER_APM_INVOICEAld.Accounting_Date,
MASTER_APM_DISTRIBUTIONAld.Status, MASTER_APM_DISTRIBUTIONAld.Description,
MASTER_APM_DISTRIBUTIONAld.Expense_Account, MASTER_APM_DISTRIBUTIONAld.Amount
FROM MASTER_APM_INVOICEAld INNER JOIN MASTER_APM_DISTRIBUTIONAld ON
(MASTER_APM_INVOICEAld.Invoice = MASTER_APM_DISTRIBUTIONAld.Invoice) AND
(MASTER_APM_INVOICEAld.Vendor = MASTER_APM_DISTRIBUTIONAld.Vendor);