INNER JOIN problem

Posted on 2004-11-23
Last Modified: 2012-05-05

I'm using a access 2000 db and I'm trying to get information from 1 table and also a second table, if the second table does not have records related to the first table it's ok, just select the fields. But right now i'm getting this error if i use the 'cb.cd_lay = 0':

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Join expression not supported.

My SQL statement is: SELECT * FROM lays l INNER JOIN cont_box cb ON cb.cd_lay = 1 WHERE l.cd_lay = 1

if i use 'cb.cd_lay = l.cd_lay' then i get a empty rs, but the table lay has a record with the cd_lay value of '1'

Question by:guster5k
    LVL 50

    Accepted Solution

    is that a character or a numeric 1

    technically they are different and should equate although access is notoriously forgiving in this area...

    (by the way this is the MS SQL SERVER topic area, there is a specific area for MS Access questions)

    have you tried
    SELECT *
    FROM lays l
    INNER JOIN cont_box cb
     ON cb.cd_lay = l.cd_lay
     WHERE l.cd_lay = 1

    you need to specify a join condition between the tables in the ON clause...
    LVL 50

    Expert Comment

    >if the second table does not have records related to the first table it's ok, just select the fields

    for this condition you need an OUTER JOIN not an inner JOIN

    SELECT *
    FROM lays l
    LEFT OUTER JOIN cont_box cb
     ON cb.cd_lay = l.cd_lay
     WHERE l.cd_lay = 1

    then you'll see Lays data event if cont_box has no related data


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    I recently came across an interesting Question In EE ( and was puzzled about how to achieve that using SSIS out of the box tasks, which was i…
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now