-
Updating records in the table
Currently i have a table called users. I wish to allow users to submit their ratings and together with the timestamp. Initially, it works with just submitting the rating alone. However when i try to submit the rating and the timestamp together, the system returns syntax error in the UPDATE statement. Can anyone help me take a look?
<%
Rate=Request.QueryString("Rating")
Session("rate")=Rate
Session("time")=Now()
Response.write(Session("time"))
SQLquery = "UPDATE users " &_
"SET (Ratings,DateTime) = ('"&Session("rate")&"','"&Session("time")&"')" &_
"where user_name ='" & Session("name") & "'"
conn.Execute(SQLquery)
%>
-
you cannot merge two source columns in an update.
try this
SQLquery = "UPDATE users " &_
"SET [Ratings] = ('"&Session("rate")&"',
[DateTime]='"&Session("time")&"')" &" where user_name ='" & Session("name") & "'"
The output of SQLQuery should be
Update users set [ratings] ='0.66',
[datetime]='12/31/2004' where
[user_name]='MAK'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|