Bruce, let's identify the problem. It is that some fields have a fixed
number of leading zeros, and others are variable length, and therefore the
fields don't match?
Possible approaches:
A. Use an Update query to change the data so it does match. You can then
create a relationship between the table, and know that they will match for
sure. Use the information in the last post to pad everything with leading
zeros to (say) 11 characters in both tables. To make an update query, use
Update on the Query menu in query design. Then once the data matches, choose
Relationships on the Tools menu to create the relation, and check the box
for Referential Integrity. Problem permanently solved.
B. If the data is constantly being dumped and the bad data being imported
again, the permanent solution doesn't apply. You might solve it by repeading
the criteria under PRODORD on the next line again (the "Or" line in query
design), and adding this to the Or line under DWGNO from OPENORD:
Like "*" & [DieData].[Dwgno]
Now it doesn't matter which of the 2 tables has the leading zeros, the text
should match.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Bruce Lawrence" <BL*****@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Sorry for dragging this out but I'm getting confused with which
solution I use or even search for.
They are text fields because of the alphanumeric values put into DWGNO.
DWGNO in the OpenOrd table is automatically filled in with an import.
DWGNO in DieData table is manually updated.
In my database, I ask the user for an order number. That order number
and the DWGNO is looked up in the OpenOrd table. I then take the DWGNO
and try to find it in the DieData table so I can get information from
that table as well.
The challenge is finding the DGWNO in DieData. DieData's is smaller
than OpenOrd's.
I have posted an image of my query online so you can see what I'm
doing.
http://www.c-o-g.com/img/qryprob.jpg