473,765 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Left Join Error

116 New Member
i'm working in access2003 trying to bring three large tables(sys_syso bjects, sys_syscolumns, and dbo_pskeydefn) into one table filtered on by fieldname of a fourth table(table_nam e_master)



Expand|Select|Wrap|Line Numbers
  1. SELECT TABLE_NAME_MASTER.F2 AS SRCE_APP_VERSION,
  2.  TABLE_NAME_MASTER.F3 AS CUST_ID,
  3. sys_sysobjects.name AS TABLE_NAME,
  4. sys_syscolumns.name AS COLUMN_NAME,
  5. sys_syscolumns.colid AS COLUMN_ID,
  6. switch( dbo_PSKEYDEFN.KEYPOSN IS NULL,0,999, dbo_PSKEYDEFN.KEYPOSN) AS KEY_POSITION,
  7. switch(sys_syscolumns.xtype = 48 or 52 or 56 or 127, 'I',
  8. sys_syscolumns.xtype = 62 or 106 or 108,'N',
  9. sys_syscolumns.xtype = 65,'L',
  10. sys_syscolumns.xtype = 61,'D',
  11. sys_syscolumns.xtype = 189,'DT',
  12. sys_syscolumns.xtype = 35 or 167 or 175 or 231 or 239,'C',
  13. 999,'UNKN') AS DATA_TYPE,
  14. switch(sys_syscolumns.xtype = 35,sys_syscolumns.length,
  15. sys_syscolumns.xtype=167 or 175 or 231 or 239,sys_syscolumns.length,
  16. 999,sys_syscolumns.xprec) as DATA_PRECISION
  17. FROM (((TABLE_NAME_MASTER INNER JOIN sys_sysobjects ON TABLE_NAME_MASTER.F1 = sys_sysobjects.name)
  18. INNER JOIN
  19. sys_syscolumns ON sys_sysobjects.id = sys_syscolumns.id)
  20. LEFT JOIN
  21. dbo_PSKEYDEFN ON (sys_syscolumns.name = dbo_PSKEYDEFN.fieldname AND dbo_PSKEYDEFN.INDEXID='_' AND dbo_PSKEYDEFN.RECNAME = MID(sys_sysobjects.name,4,30) ))
  22. ORDER BY sys_sysobjects.name;

The major chunk of the code runs fine but access gives me the error join expression not supported when i try to add in sys_syscolumns. name = dbo_PSKEYDEFN.f ieldname in this section of code.

Expand|Select|Wrap|Line Numbers
  1. LEFT JOIN
  2. dbo_PSKEYDEFN ON (sys_syscolumns.name = dbo_PSKEYDEFN.fieldname AND dbo_PSKEYDEFN.INDEXID='_' AND dbo_PSKEYDEFN.RECNAME = MID(sys_sysobjects.name,4,30) ))
  3. ORDER BY sys_sysobjects.name;
Any help you could give me would be most appreciated. I started working with Access last week and have just been learning as i go.

Eric
Feb 28 '07 #1
4 2730
NeoPa
32,572 Recognized Expert Moderator MVP
Eric,
Your problem is that JOINs should follow the format :
Expand|Select|Wrap|Line Numbers
  1. TX JOIN TY ON TX.FieldA = TY.FieldB AND TX.FieldC = TY.FieldD
Other restrictions applied should be in a WHERE clause. Does this make sense to you?
Feb 28 '07 #2
NeoPa
32,572 Recognized Expert Moderator MVP
Just to clarify, Functions which take fields from one of the input sources do not qualify, nor do literal values.
Only the fields defined in the record sources can be used. The rest belongs in a WHERE clause.
You may find it easier to design this first in the design window. This will automatically restrict you from doing invalid things.
Feb 28 '07 #3
phytorion
116 New Member
Just to clarify, Functions which take fields from one of the input sources do not qualify, nor do literal values.
Only the fields defined in the record sources can be used. The rest belongs in a WHERE clause.
You may find it easier to design this first in the design window. This will automatically restrict you from doing invalid things.

Yeah i finally got it to work. its definitly picky about what it allows you to do =Þ. Thanks for the help.
Feb 28 '07 #4
NeoPa
32,572 Recognized Expert Moderator MVP
The restrictions make sense though.
What you were trying to do indicated a lack of understanding of what is actually going on. You're better off that it tells you now rather than allowing further confusion.
Glad you got it sorted though :)
Feb 28 '07 #5

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

Similar topics

2
16739
by: michael | last post by:
Gotta post because this is driving me nuts. Trying to DELETE orphans. I can successfully: SELECT GroupID FROM Groups LEFT JOIN Users ON UsersID = UserID WHERE UsersID IS NULL; but when I try: DELETE FROM Groups LEFT JOIN Users ON UsersID = UserID WHERE UsersID
0
1803
by: Justin | last post by:
Hi. I decided to tidy up some of my queries, but I came across something that stumpt me: mysql> SELECT -> jobs.jobId, -> jobs.active, -> jobs.title, -> jobs.listed, -> industries.industry, -> occupations.occupation,
2
1776
by: R. Tarazi | last post by:
Hello, DB-structure: ========= firmendaten ----------------- firmendatenid <- firmennummer name strasse
2
2743
by: Scott Snella | last post by:
Hi, I hope this is the right place to post, but, I am having a problem with an UPDATE command and a LEFT JOIN, I am using something like: UPDATE table_a LEFT JOIN table_b ON table_a.field1=table_b.field1 SET table_b.field6='1' WHERE table_a.field2='1'; Something along those lines. Anyway, from what I can see on various web sites, documentation, etc, I think it should work, however, I keep getting this error...
4
4107
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the results, then doing a self left join with those results, etc. What puzzles me is that the time required for the query seems to grow exponentially as I add additional left joins, which I didn't expect. I expected the inner select to return about 25...
5
3358
by: man7 | last post by:
Hi Im having problems migrating a query from Oracle to MS Access..after much modification i arrived at this query: SELECT t4.org_nm, t1.run_id, t3.org_id, t1.Plan_Yr_n, t2.plan_id, t3.Opt_Out_i, (IIf(t3.Prod_ty_c="EPO","HMO",t3.Prod_ty_c)) as Product, t3.bus_ln_c, t3.FUND_TY_C, t2.orig_plan_c, t2.orig_plan_nm FROM (((BENEXCH_T_RIBT_BTCH t1
2
8440
by: lelandhuang | last post by:
I am developing reporting service and using lots of 'LEFT OUTER JOIN', I am worried about the performance and want to use some subquery to improve the performance. Could I do that like below, SELECT * FROM TableA LEFT OUTER JOIN TableB
0
2286
by: yeahuh | last post by:
Quick and dirty version. Godaddy server using MySQL 4.0.24 I’m trying a left join to obtain id’s in table A(cars) that are NOT in car_id in table B(newspaper): *This is a cut down version to simplify testing. Full version is posted towards the end. SELECT C.id FROM cars C LEFT OUTER JOIN newspaper N USING (C.id=N.car_id) WHERE N.car_id IS NOT NULL;
4
2114
by: markcarroll | last post by:
Right now I have the following SQL query inside of an access database: It works, but it runs VERY slowly. I figure I could speed it up if I could inculde the WHERE conditions as part of of the LEFT JOIN: Access gives me an error why I try this. Apparently, the Join expression is not supported. I was wondering if there was some work around in Access?
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.