If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > inner join error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-04, 04:23
fisya fisya is offline
Registered User
 
Join Date: Mar 2004
Posts: 53
Unhappy 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
Reply With Quote
  #2 (permalink)  
Old 04-12-04, 06:21
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
missing a comma
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 04-12-04, 12:59
rdjabarov rdjabarov is offline
Registered User
 
Join Date: Jul 2003
Location: San Antonio, TX
Posts: 3,611
Quote:
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On