Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining Tables with Added Spaces in Field

Status
Not open for further replies.

jvleigh221

IS-IT--Management
Oct 27, 2006
9
0
0
US
In joining two tables in a query I'm running into a problem.

In the main table, the field entry is normal. For example Table1.ID = "ID_104"

However in the Table I'm Left Joining the Feild entry has trailing spaces, Table2.ID = "ID_104 "

When I try to join the two and run the query I get an Invalid Operation. I'm guessing due to the fact that they do not match up because of the trailing spaces.

How can I get the two tables to join properly?

Thanks.
Jeremy
 
I do not think that it is the spaces. Can you post the SQL and the error messages, please?
 
I simplified it best I can:

SELECT [qryORIGINAL].CTRL_NBR, INV_ITEM.GSTYLE, INV_STYLE.ECK_US_ECCN
FROM ([qryORIGINAL] LEFT JOIN INV_ITEM ON [qryORIGINAL].ITEM_NBR = INV_ITEM.ITEM_NBR) LEFT JOIN INV_STYLE ON INV_ITEM.GSTYLE = INV_STYLE.STYLE;

The Query referenced above pulls from the database table all records pertaining to a specific CTRL_NBR.

The error I get is "Invalid Operation"

Thanks,
Jeremy
 
Have you tried the query in its simplified form? Does it return the same error?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top