PDA

View Full Version : To few parameters expected 1 - SQl


Mhtml
10-27-2002, 02:16 AM
sql_select="SELECT * FROM News where Month ="&request.Form("Month")

When that is executed I get the error to few parameters expected 1 ...

rcreyes
10-27-2002, 02:42 AM
Make sure you have a space between the & request.form

sql_select="SELECT * FROM News where Month =" & request.Form("Month")

whammy
10-27-2002, 03:13 AM
That may be a problem, but I don't know since I am very particular about my code formatting... if that doesn't solve it, then perhaps you could print the SQL statement to the page? i.e.:

sql_select="SELECT * FROM News where Month =" & Request.Form("Month")
Response.Write(sql_select) : Response.End

and post that here? That's usually the best way to figure out what's going wrong with a SQL statement.

P.S. Is Month a varchar or other text datatype in your database? If so the syntax of your SQL query is wrong.

Mhtml
10-27-2002, 04:51 AM
I figured it out about 5mins after posting this, in my form field called month which is a select the values were jan, feb etc but I had changed my database to use the month numbers and forgot to change my select so it couldn't work.

I have almost finished the script, it is a news management script so you can archive news on a website only v1 though planning on having a more flexible version with more options in the next ver.

Mhtml
10-27-2002, 04:54 AM
...

whammy
10-27-2002, 09:16 AM
P.S. Here's one way to do date dropdowns you might find interesting.