473,383 Members | 1,759 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,383 software developers and data experts.

Why can I only use INNER JOIN

Hello.

In the following query:

SELECT tblDokumentiDetails.ID_Artikel, - tblDokumentiDetails.Kolicina
AS Kolicina
FROM (tblDokumenti INNER JOIN tblDokumentiDetails ON
tblDokumenti.ID_Dokument = tblDokumentiDetails.ID_Dokument) INNER JOIN
[SELECT tblDokumentiDetails.ID_Artikel, Max(tblDokumenti.Datum) AS
ZadnjiDatum
FROM tblDokumenti INNER JOIN tblDokumentiDetails ON
tblDokumenti.ID_Dokument = tblDokumentiDetails.ID_Dokument
WHERE tblDokumenti.ID_Vrsta=3 And tblDokumenti.Storniran=false And
tblDokumenti.Zakljucen=true
GROUP BY tblDokumentiDetails.ID_Artikel]. AS ZadnjaInventura ON
(tblDokumentiDetails.ID_Artikel = ZadnjaInventura.ID_Artikel) AND
(ZadnjaInventura.ZadnjiDatum < tblDokumenti.Datum)
WHERE tblDokumenti.ID_Vrsta = 2 And tblDokumenti.Storniran=false And
tblDokumenti.Zakljucen=true;
I want to use LEFT JOIN instead of INNER JOIN at second join (INNER
JOIN [SELECT...), but I get error: Join expression not supported. Can
you help me please? Must I put parentheses some way there? What is the
use of "[" and "]."?

May 20 '07 #1
3 2914
What is the
use of "[" and "]."?
The [ ]. denotes a sub-query. in this case you are joining to a sub-
query named ZadnjaInventura.

The access treatment of SQL code behind sub-queries is a little odd.
When editing a query with a sub-query in the SQL editor, you need to
replace the "[...]. AS ..." with "(...) AS ...", otherwise the jet
compiler won't be able to handle it. Once you edit in the graphic
editor, it converts it back to the "[...]. AS ..." format.

So try either:
1. edit the whole thing in the graphic editor - double click the line
representing the join and select from the options to create a left
join, or
2. edit in the SQL editor, but always replace "[" with "(" and "]."
with ")" before you run it

Good luck

May 21 '07 #2
graphic editor complains something... when I replace "[" and "]." with
"(", ")" it stil works. But when I change INNER to LEFT (JOIN) same
error. grrr.

BillCo je napisal:
What is the
use of "[" and "]."?

The [ ]. denotes a sub-query. in this case you are joining to a sub-
query named ZadnjaInventura.

The access treatment of SQL code behind sub-queries is a little odd.
When editing a query with a sub-query in the SQL editor, you need to
replace the "[...]. AS ..." with "(...) AS ...", otherwise the jet
compiler won't be able to handle it. Once you edit in the graphic
editor, it converts it back to the "[...]. AS ..." format.

So try either:
1. edit the whole thing in the graphic editor - double click the line
representing the join and select from the options to create a left
join, or
2. edit in the SQL editor, but always replace "[" with "(" and "]."
with ")" before you run it

Good luck
May 21 '07 #3
On May 21, 8:50 pm, janko.klemen...@gmail.com wrote:
graphic editor complains something... when I replace "[" and "]." with
"(", ")" it stil works. But when I change INNER to LEFT (JOIN) same
error. grrr.
that's odd - check for data corruption in the tables and make sure the
the joined fields have the exact same data type attributes. beyond
that i'm mystified as you!

May 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ike | last post by:
Oh I have a nasty query which runs incredibly slowly. I am running MySQL 4.0.20-standard. Thus, in trying to expedite the query, I am trying to set indexes in my tables. My query requires four...
3
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName,...
4
by: Nathan | last post by:
I have an application that uses an Access database to gather information on students' test scores. In the database there are three tables which are joined by one- to-many relationships: ...
6
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
3
by: Zeff | last post by:
Hi all, I have a relational database, where all info is kept in separate tables and just the id's from those tables are stored in one central table (tblMaster)... I want to perform a query, so...
12
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
1
by: teneesh | last post by:
Here I have a code for a view that has been created by a developer on my team. I am trying to use the very same code to create a view for a different formid/quesid. But I cannot figure out how this...
2
by: MATTXtwo | last post by:
I have this store procedure to select data from table with join like this...SELECT tblPeribadi.Personel_No, tblPeribadi.Nama,tblCompany.Keterangan as Company_Code, tblPeribadi.Jawatan,...
4
by: AXESMI59 | last post by:
I created a query in the Access Query Builder that I modified to use with VBA Code so I could reuse it for any record I choose. The one that I created with the Access Query builder works beautifully...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.