Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    2

    Unanswered: syntax error for 'INNER JOIN'

    hi all,

    I have a weird problem, which i'm unable to understand.


    I created a SQL query using 'INNER JOIN' and my query is

    SELECT
    datackt1.`D_CKT`, datackt1.`D_SIGNAL`, datackt1.`D_BLDG1`,
    dwo1.`DWO_TYPE`, dwo1.`DWO_CURREN`

    FROM
    { oj `datackt` datackt1 INNER JOIN `dwo` dwo1 ON
    datackt1.`D_STANUM` = dwo1.`DWO_CKT`}


    WHERE
    dwo1.`DWO_CURREN` = 'Y' AND
    (datackt1.`D_SIGNAL` = '10BaseT' OR
    datackt1.`D_SIGNAL` = '100BaseTX') AND
    (dwo1.`DWO_TYPE` <> '*CANCEL*' AND
    dwo1.`DWO_TYPE` <> 'Cancelled DWO' AND
    dwo1.`DWO_TYPE` <> 'Deactivate' AND
    dwo1.`DWO_TYPE` <> 'Information Only')

    where datackt and dwo are my database tables.

    when i try to run this query i get a message :

    ODBC error: [MySQL][ODBC 3.51 Driver][mysqld-4.0.16-nt] you have an error in your SQL syntax .check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN 'dwo' dwo1 ON datackt1, 'D_STRANUM'=dwo1.'DWO_CKT'}

    i verified that the fields D_STRANUM and DWO_CKT are of the same type.

    i'm using crystal reports to generate queries.

    I'm new to SQL. can anyone help me.

  2. #2
    Join Date
    Jul 2004
    Posts
    1

    Syntax Error for JOIN

    After removing {oj ... } the JOIN statement above will work.

  3. #3
    Join Date
    Sep 2012
    Posts
    1

    Thumbs up RE: antzs



    Salute for antzs. Your advice really solved my issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •