Web Hosting Talk







View Full Version : ASP syntax error


tuvok
02-05-2002, 12:27 PM
Hi Guys, can you help me out please, i have been looking at this code for hours and still get syntax error.

--------------------------------------------
SQLstmt = "UPDATE domaindetails SET (day, month, year, renewal) VALUES ('" & dayq & "','" & monthq & "','" & yearq & "','" & renewq & "')"
SQLStmt = SQLStmt & " WHERE accountnumber='"& accountnumber & "' "
Set RS = Conn.Execute(SQLStmt)
--------------------------------------------



Error desc. -> [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement

ASPCode.net
02-05-2002, 12:50 PM
This thread is posted in the wrong forum but I'll answer it anyway:

The syntax UPDATE table SET field=VALUE, field2=VALUE2 WHERE...

So something like this

SQLstmt = "UPDATE domaindetails SET day='" & dayq & "',month='" & monthq & "', year="' & renewq &"'"

Also please note that your syntax is only valid if you are day/month/year are varchar fields. If they are numeric fields you should get rid of the ':s

tuvok
02-05-2002, 12:59 PM
Thanks for the help, that fixed it.. i will check for the correct place to post such requests in the future

cheers