473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Join expression not supported

I'm trying to do a left join on two fields which don't have the same amount of characters.

I'm using the following:

Expand|Select|Wrap|Line Numbers
  1. SELECT TABLE1.BKGNBR, TABLE2.DOCNBR
  2. FROM TABLE1 LEFT JOIN TABLE2 ON TABLE1.BKGNBR = LEFT(TABLE2.DOCNBR,9);
  3.  
When doing this I'm getting JOIN expression not supported.

I really need to take all records on TABLE1 and only the records in TABLE2 taking the first 9 characters to make this join.

Can you help me?
Mar 3 '14 #1
3 1369
zmbd
5,501 Expert Mod 4TB
why?
There is a very serious design flaw in your database if you are attempting this method of matching...

Your sentence might look like:

Expand|Select|Wrap|Line Numbers
  1. SELECT TABLE1.BKGNBR, TABLE2.DOCNBR 
  2. FROM TABLE1, TABLE2
  3. WHERE ((Left$([BKGNBR],9)=Left$([DOCNBR],9)));
Although I've not ran this so it may not return exactly what you want....

What I would do, is create two queries with calculated field that returns just the left-9, and then make the join using these queries... you can do this all in one go; however, this might be easier to follow.

How is this different from your other thread: http://bytes.com/topic/access/answer...t-lengths-data
Mar 3 '14 #2
Thank you for your answer.
I had lost track of that thread (I apologize I'm very new at this).
It is not different at all, the result I'm trying to achieve is the same.
However the tables were created a long time ago and therefore I don't think they considerated communicating these 2 tables together even though they share crucial data.

Now, I have tried creating queries with calculated fields as you suggested but the response time is way over 180 secs which I'm trying to optimize.

Any ideas?
Mar 3 '14 #3
zmbd
5,501 Expert Mod 4TB
I don't see any solution for you beyond what I've offered other than the most obvious, and perhaps not even possible for you.... start from scratch and rebuild the database properly.

I know the pain... I'm in a company now that due to regulations has to keep the old legacy databases, so as they've grown and moved from one to the next, the old mules have stayed hooked to the train... requiring that often the data is "transferred" in batches from one system to another using mapping, triggers, and code to get things in the right places.

That is perhaps what you might have to do, pull the information from the older system to the new, properly designed database and then push your data back out to the old one.... sort of a kludge I know - but the best I have for you right now.

BTW: Go to your profile settings, there you can set how emails are sent to you when threads that you subscribe to are updated and when you receive PM in your Bytes.com account.

BOL
-z
Mar 3 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Phil Powell | last post by:
<cfquery name="getAll" datasource="#request.dsn#"> SELECT U.userID, U.fname, U.lname, U.phone, U.lastLoggedIn, U.choiceId, U.experience, T.label AS teamLabel, R.label AS roleLabel FROM User U...
9
by: Mike Bridge | last post by:
I am using MS Access 2003, and I typed in a query in SQL view which was working fine. Now when I open it, it gives me the error "Join expression not supported". Apparently, Access "fixed" it for...
14
by: Ryan | last post by:
I want to do the following SQL statement in Access. However, it won't allow me to have the secondary part of my join statement and tells me that this is not supported. OK, so Access doesn't support...
3
by: pritampatil | last post by:
Hi All, I tried to run the attached query in MS-Access but its giving error "Join expression not supported" I am unable to find the cause of it till now, please try to find the same and help me. ...
4
by: BigNorm | last post by:
I have a top query which works fine, and a bottom query will also works fine when you run them by themselves, but when you combine them with a union, I get the message "Join Expression not...
17
by: Wesley Hader | last post by:
I have been working on making my DB DSN-less and I have a bit of a problem. After racking my brain all day over the ODBC connection string to an Informix database and how to link to the tables as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.