Can you tell me what is wrong with my ORDER BY statement below. I get the following error "Missing semicolon ( at end of SQL statement". Thanks.
MyVar1 = Request.Querystring("CustomerNumber"
MyVar2 = Request.Querystring("AttendeeFirstName"
MyVar3 = Request.QueryString("AttendeeLastName"
MyVar4 = Request.QueryString("Orderby"
strsql = "select * from Customer WHERE CUSTOMERNUMBER='" & myVar1 & "'"
set rs = Server.CreateObject("ADODB.Recordset"
If MyVar4 ="" then
sql = "update Attendee set Printed=TRUE WHERE CustomerNumber='" & myVar1 & "' and AttendeeFirstName='" & myVar2 & "' and AttendeeLastName='" & myVar3 & "'"
else
sql = "update Attendee set Printed=TRUE WHERE CustomerNumber='" & myVar1 & "' and AttendeeFirstName='" & myVar2 & "' and AttendeeLastName='" & myVar3 & "'"
sql = sql & " ORDER BY '" & MyVar4 & "'"
end if
conn.Execute (sql)
MyVar1 = Request.Querystring("CustomerNumber"
MyVar2 = Request.Querystring("AttendeeFirstName"
MyVar3 = Request.QueryString("AttendeeLastName"
MyVar4 = Request.QueryString("Orderby"
strsql = "select * from Customer WHERE CUSTOMERNUMBER='" & myVar1 & "'"
set rs = Server.CreateObject("ADODB.Recordset"
If MyVar4 ="" then
sql = "update Attendee set Printed=TRUE WHERE CustomerNumber='" & myVar1 & "' and AttendeeFirstName='" & myVar2 & "' and AttendeeLastName='" & myVar3 & "'"
else
sql = "update Attendee set Printed=TRUE WHERE CustomerNumber='" & myVar1 & "' and AttendeeFirstName='" & myVar2 & "' and AttendeeLastName='" & myVar3 & "'"
sql = sql & " ORDER BY '" & MyVar4 & "'"
end if
conn.Execute (sql)