Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL problem

Status
Not open for further replies.

Juppo

Technical User
Jun 13, 2003
15
GB
I've got a problem with the sql I've just written. The error I get is
Code:
 Syntax error (missing operator) in query expression 'QUOTE NO = 6563'

Im guessing its because of the field name 'QUOTE NO' that should really be called QuoteNo but is there some way to make sql accept that name? Have I just missed out something?

thanks
Code:
cn1="DRIVER={Microsoft Access Driver (*.mdb)};"
	cn1=cn1 & "DBQ=" & data_root & accessdb
	Set rs1 = Server.CreateObject("ADODB.Recordset")				
if QUOTE_NO = "" then
	sql = "SELECT * FROM All_Quotes" 
else
sql = "SELECT * FROM All_Quotes WHERE QUOTE NO = "& QUOTE_NO &""
Code:
end if
	rs1.Open sql, cn1
 
Code:
sql = "SELECT * FROM All_Quotes WHERE [quote=NO] = "& QUOTE_NO

You shouldn't use space in column names. Furthermore, you should have posted in the Access forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top