Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    53

    Unhappy Unanswered: inner join error

    i have 2 table which i have to do inner join in way to display the info. however, every time i do it i will get a syntax error. i don't know how to solve it. below is the code :

    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/sambungan.asp" -->
    <%
    Dim Recordset1__MMColParam
    Recordset1__MMColParam = "1"
    If (Request.QueryString("caricetak") <> "") Then
    Recordset1__MMColParam = Request.QueryString("caricetak")
    End If
    %>
    <%
    Dim Recordset1
    Dim Recordset1_numRows

    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_sambungan_STRING
    Recordset1.Source = "SELECT tb_aduan.id_aduan,tb_aduan.id_user,tb_aduan.kod_ke rosakan,tb_aduan.sebab_kerosakan,tb_aduan.lokasi,t b_aduan.blok,tb_aduan.tingkat,tb_aduan.no_bilik,tb _aduan.tarikhmasa,tb_aduan.arahan,tb_aduan.bhn_gan ti,tb_aduan.laporan,tb_aduan.status_id,tb_aduan.ju mlah_kos,tb_aduan.upah,tb_aduan.kosbhn_ganti,tb_ad uan.perundingan,staff IT.nostaffuitm,staff IT.namastaffuitm,staff IT.kodjawatan,staff IT.samb FROM tb_aduan INNER JOIN staff IT ON tb_aduan.id_user= staff IT.nostaffuitm WHERE id_aduan = " + Replace(Recordset1__MMColParam, "'", "''") + ""
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 1
    Recordset1.Open()

    Recordset1_numRows = 0
    %>


    and the error is:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'staff IT.nostaffuitm'.
    /systemku/TMP29ngbw1a3o.asp, line 20

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    missing a comma
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Originally posted by r937
    missing a comma
    I don't think that's the problem. Try to surround any reference to staff IT with [], like [staff IT].nostaffuitm.

Posting Permissions

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