A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Matching data in two tables



 
 
Thread Tools Display Modes
  #1  
Old May 28th, 2010, 03:24 PM posted to microsoft.public.access.forms
jet04
external usenet poster
 
Posts: 2
Default Matching data in two tables

This is probably pretty rudimentary but I'm doing an Update Query in 2007 and
I am having an issue with my criteria.

I have two tables:
tbl_1 contains a column with a serial number (14,000 rows) .
tbl_2 contains a column with user description information that includes the
serial numbers I want to match. (45,000 rows)

tbl_1 field: 673567
tbl_2 field: FTN 673567 333, Doe John, W, X,

Here is my query in SQL:
UPDATE tbl_2, tbl_1
SET tbl_2.[Compare Match] = "Match"
WHERE (((tbl_2.Descriptor) Like '*' & [tbl_1]![Serial Number] & '*'));

I actually get this query to work with smaller data tables, but there seems
to be a conflict with the size of my two tables and the criteria I'm using to
do the match (200 rows against 14,000). Any ideas. This really should be
jumping out at me but it is not. Thanks.

  #2  
Old May 28th, 2010, 03:42 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Matching data in two tables

On Fri, 28 May 2010 14:24:09 GMT, "jet04" u60414@uwe wrote:

Are you getting any errors?
I could see that this is slow,because you are creating a carthesian
product by selecting tbl_2, tbl1. That produces 14000 * 45000 results,
which you then join using a wildcard on both sides. Yes, that may take
a while...
If the serial number in tbl_2 is in a predictable location or has a
predictable format it may be better to pull it out first (e.g.
Mid$(Descriptor, 5, 6), store it in a temporary field, and then inner
join the two serialno fields.

-Tom.
Microsoft Access MVP


This is probably pretty rudimentary but I'm doing an Update Query in 2007 and
I am having an issue with my criteria.

I have two tables:
tbl_1 contains a column with a serial number (14,000 rows) .
tbl_2 contains a column with user description information that includes the
serial numbers I want to match. (45,000 rows)

tbl_1 field: 673567
tbl_2 field: FTN 673567 333, Doe John, W, X,

Here is my query in SQL:
UPDATE tbl_2, tbl_1
SET tbl_2.[Compare Match] = "Match"
WHERE (((tbl_2.Descriptor) Like '*' & [tbl_1]![Serial Number] & '*'));

I actually get this query to work with smaller data tables, but there seems
to be a conflict with the size of my two tables and the criteria I'm using to
do the match (200 rows against 14,000). Any ideas. This really should be
jumping out at me but it is not. Thanks.

  #3  
Old May 28th, 2010, 04:17 PM posted to microsoft.public.access.forms
jet04
external usenet poster
 
Posts: 2
Default Matching data in two tables

Tom,

No errors other than the query taking a long time, which you spoke to. The
join sounds like what i should have tried in the beginning due to the data
size, but was hoping magic would happen. Ha!

Thanks.

Tom van Stiphout wrote:
Are you getting any errors?
I could see that this is slow,because you are creating a carthesian
product by selecting tbl_2, tbl1. That produces 14000 * 45000 results,
which you then join using a wildcard on both sides. Yes, that may take
a while...
If the serial number in tbl_2 is in a predictable location or has a
predictable format it may be better to pull it out first (e.g.
Mid$(Descriptor, 5, 6), store it in a temporary field, and then inner
join the two serialno fields.

-Tom.
Microsoft Access MVP

This is probably pretty rudimentary but I'm doing an Update Query in 2007 and
I am having an issue with my criteria.

[quoted text clipped - 16 lines]
do the match (200 rows against 14,000). Any ideas. This really should be
jumping out at me but it is not. Thanks.


  #4  
Old May 28th, 2010, 04:48 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Matching data in two tables

Or instead of storing the results save the query and use it in another query
to join fields.

--
Build a little, test a little.


"Tom van Stiphout" wrote:

On Fri, 28 May 2010 14:24:09 GMT, "jet04" u60414@uwe wrote:

Are you getting any errors?
I could see that this is slow,because you are creating a carthesian
product by selecting tbl_2, tbl1. That produces 14000 * 45000 results,
which you then join using a wildcard on both sides. Yes, that may take
a while...
If the serial number in tbl_2 is in a predictable location or has a
predictable format it may be better to pull it out first (e.g.
Mid$(Descriptor, 5, 6), store it in a temporary field, and then inner
join the two serialno fields.

-Tom.
Microsoft Access MVP


This is probably pretty rudimentary but I'm doing an Update Query in 2007 and
I am having an issue with my criteria.

I have two tables:
tbl_1 contains a column with a serial number (14,000 rows) .
tbl_2 contains a column with user description information that includes the
serial numbers I want to match. (45,000 rows)

tbl_1 field: 673567
tbl_2 field: FTN 673567 333, Doe John, W, X,

Here is my query in SQL:
UPDATE tbl_2, tbl_1
SET tbl_2.[Compare Match] = "Match"
WHERE (((tbl_2.Descriptor) Like '*' & [tbl_1]![Serial Number] & '*'));

I actually get this query to work with smaller data tables, but there seems
to be a conflict with the size of my two tables and the criteria I'm using to
do the match (200 rows against 14,000). Any ideas. This really should be
jumping out at me but it is not. Thanks.

.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.