View Full Version : Syntax error (missing operator) in query expression

09-09-2005, 02:00 PM
I have no problem in first time showing the data, with my sql as below

sql4="select * from tblFiles where WorkWeek >= "&request("Beginww")&" order by WorkWeek DESC"
but when I click on a link like below it will give me an syntax error(missing operator) but when I point to the link it giving me the correct link address for example if my Beginww= 15 then my link address will be

after I click on it the error come...
my code is as below:

pagelink = "browsebypkg.asp?Workweek>="&request("Beginww")

please help to solve this..tks

09-09-2005, 06:12 PM
Lose the ">". And your variables should be named the same if you are using the same variable from page to page.

pagelink = "browsebypkg.asp?Workweek="&request("Workweek")

09-10-2005, 01:21 AM
You might also try referencing it as Request.Form("Workweek").....If you leave out the ".Form" it may default to some other property of the Request object (like all querystrings concatenated together - I forget)

Also, you really shold not pass an unchecked QueryString parm to a SQL statement. Do a google on "SQL Injection Attacks" to learn more.