April 14th, 2009, 07:25 AM
Join Date: Apr 2009
Time spent in forums: 29 m 50 sec
Reputation Power: 0
Syntax error (missing operator) in query expression
I've seen a few similar threads, but I can't quite figure this out.
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'CUST.UNIQ_CUST_ID='.
/nexus/cst_detail.asp, line 56
' Create an empty recordset object
Set rst = Server.CreateObject("ADODB.Recordset")
' Create the SQL statement and stick it in varSQL
varSQL = "SELECT CUST_CNTCT.LAST_UPDT_ON_DT, CUST_CNTCT.SOURCE_NM, CUST_CNTCT.FIRST_NM, CUST_CNTCT.LAST_NM, CUST_CNTCT.TITLE_NM, " & _
"CUST_CNTCT.EMAIL_ADDR, CUST_CNTCT.COMP_EMAIL_ADDR, CUST.* " & _
"FROM CUST_CNTCT INNER JOIN CUST ON CUST_CNTCT.UNIQ_CUST_ID = CUST.UNIQ_CUST_ID " & _
"WHERE CUST.UNIQ_CUST_ID=" & session("cust_id")
' Fill the recordset with records based on the SQL statement in varSQL
set rst = Conn.Execute(varsql)
The last line is the offending one,
I have the exact same page elsewhere that works
; only except it's a number instead of a name. both are treated as strings, not integers.
What could cause this? only difference I see is that my data in field UNIQ_CUST_ID has spaces in it.