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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a join on a portion of a text field? 1

Status
Not open for further replies.

pyroskliq

Technical User
Jan 17, 2001
29
US
I have a field that I need to create a join on that is (a string) 16 characters long. I only want to join on the first 15 characters in the string. I've used MS Foxpro (sparingly) and have seen joins like this. Is this possible with Access? Or do I need to create a function to 'extract' the 15 characters I need to a new field (in both tables) then do the join on the new 15 character wide string?

Thanks!
 
I am not sure what you mean by a join on a text field, but to extract the first 15 characters of a string, use the LEFT() function:
Code:
LEFT('ABCDEFGHIJKLMNOPQRSTUVWXYZ',15) will return 'ABCDEFGHIJKLMNO'
Hope that helps... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
If you're joining two fields in a query, you'll need to do an intermediate query with the function above, then join with that in your 2nd query. I don't think there is any way around it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top