Hi,
my query is below.
If Request("query_type"
= "name" Then
sqlQ = sqlQ & " WHERE Employee.last_name = " Request("txtlast_name"
ElseIf Request("query_type"
= "location" Then
sqlQ = sqlQ & " WHERE Employee.location_id = " & CInt(Request("txtquery"
) & " ORDER BY Employee.last_name, Employee.first_name"
ElseIf Request("query_type"
= "dept" Then
sqlQ = sqlQ & " WHERE Employee.department_id = " & CInt(Request("txtquery"
) & " ORDER BY Employee.last_name, Employee.first_name"
End If
The location and dept return data from the db just fine. The name does not. When the user inputs a name on the form, this error is generated:
Expected end of statement
sqlQ = sqlQ & " WHERE Employee.last_name = " Request("txtlast_name"
---------------------------------------------^
below is the code from the input on the form, :
<input type="hidden" name="query_type" value="name">
<input type="text" name="txtlast_name" size="20" value= "" tabindex="1">
Any idea on why the last name wont search?
my query is below.
If Request("query_type"

sqlQ = sqlQ & " WHERE Employee.last_name = " Request("txtlast_name"
ElseIf Request("query_type"

sqlQ = sqlQ & " WHERE Employee.location_id = " & CInt(Request("txtquery"

ElseIf Request("query_type"

sqlQ = sqlQ & " WHERE Employee.department_id = " & CInt(Request("txtquery"

End If
The location and dept return data from the db just fine. The name does not. When the user inputs a name on the form, this error is generated:
Expected end of statement
sqlQ = sqlQ & " WHERE Employee.last_name = " Request("txtlast_name"

---------------------------------------------^
below is the code from the input on the form, :
<input type="hidden" name="query_type" value="name">
<input type="text" name="txtlast_name" size="20" value= "" tabindex="1">
Any idea on why the last name wont search?