PC Review


Reply
Thread Tools Rate Thread

How do I force exact match in text inner join

 
 
=?Utf-8?B?UEVHUGdybQ==?=
Guest
Posts: n/a
 
      24th Aug 2006
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);

 
Reply With Quote
 
 
 
 
John Vinson
Guest
Posts: n/a
 
      24th Aug 2006
On Thu, 24 Aug 2006 11:41:01 -0700, PEGPgrm
<(E-Mail Removed)> wrote:

>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?


Not familiar with Pervasive, but it certainly appears as if Access is
interpreting the field as a number rather than as a Text datatype.
Check the table defininition and the linking process to ensure that
the fields are being seen as Text.

John W. Vinson[MVP]
 
Reply With Quote
 
=?Utf-8?B?UEVHUGdybQ==?=
Guest
Posts: n/a
 
      24th Aug 2006
Thanks, John. I did check that very first thing, it is set as text. Some of
the records contain alpha characters in the Invoice field, so it clearly
isn't a numeric field.

"PEGPgrm" wrote:

> 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);
>

 
Reply With Quote
 
John Vinson
Guest
Posts: n/a
 
      25th Aug 2006
On Thu, 24 Aug 2006 11:41:01 -0700, PEGPgrm
<(E-Mail Removed)> wrote:

>The tables are
>Pervasive Data tables linked using the Timberline ODBC driver.


You might want to check with Timberline then - the symptom certainly
sounds like it's inappropriately truncating leading zeroes as part of
the linking process.

I have to really question the original database designer's choice of
having two distinct ID's, both numeric in appearance, differing only
by a leading zero - that's tough for humans *or* computers!

John W. Vinson[MVP]
 
Reply With Quote
 
=?Utf-8?B?UEVHUGdybQ==?=
Guest
Posts: n/a
 
      25th Aug 2006
That's the problem with having users who aren't programmers. I guess we'll
have to banish them all to Siberia. This particular user is also fond of
putting special characters in key fields, like vendor id = H & R Block or
vendor id = **This**That**. I'm just a lowly IT grunt, so I have to deal
with what I get!

I will try calling Timberline, tho they will try to fob me off on a
consultant!

Thanks for your input.

"John Vinson" wrote:

> On Thu, 24 Aug 2006 11:41:01 -0700, PEGPgrm
> <(E-Mail Removed)> wrote:
>
> >The tables are
> >Pervasive Data tables linked using the Timberline ODBC driver.

>
> You might want to check with Timberline then - the symptom certainly
> sounds like it's inappropriately truncating leading zeroes as part of
> the linking process.
>
> I have to really question the original database designer's choice of
> having two distinct ID's, both numeric in appearance, differing only
> by a leading zero - that's tough for humans *or* computers!
>
> John W. Vinson[MVP]
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using VLookup when text isn't an exact match Ken K Microsoft Excel Worksheet Functions 2 19th Aug 2009 04:20 PM
Find exact text match Graham Microsoft Excel Programming 4 7th Apr 2008 12:27 PM
Return exact match in text containing hyphen shelter@jointanimalservices.org Microsoft Access Queries 2 16th Feb 2006 11:38 PM
search a text cell CONTAINING matching text in a dynamic range (not exact match) msgoldcup@gmail.com Microsoft Excel Discussion 3 19th Jul 2005 07:20 PM
Join Queries - can you join two tables with similar records, not an exact match? John Goodrich Microsoft Access Queries 1 15th Sep 2004 07:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:59 PM.