sql help

  • Thread starter Thread starter matt shudy
  • Start date Start date
M

matt shudy

Hi,

Can someone help me with this sql statement...

strSQL= "SELECT * FROM Results WHERE location = '" &
Request.Form("location") & "' AND year = " & Request.Form
("Year")

I get this error when I view the page

Microsoft OLE DB Provider for ODBC Drivers
error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type
mismatch in criteria expression.

Is there anything wrong with the statement that catches
your eye right away?

Thanks,

Matt
 
What type of field is "year" in your database?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
And make it a text field.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Bob Lehmann said:
YEAR is a reserved word. Either bracket it - [year] - or change its name.

Bob Lehmann

matt shudy said:
it is a number field just the four digit year ex 2003.

matt
-----Original Message-----
What type of field is "year" in your database?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Hi,

Can someone help me with this sql statement...

strSQL= "SELECT * FROM Results WHERE location = '" &
Request.Form("location") & "' AND year = " & Request.Form
("Year")

I get this error when I view the page

Microsoft OLE DB Provider for ODBC Drivers
error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type
mismatch in criteria expression.

Is there anything wrong with the statement that catches
your eye right away?

Thanks,

Matt


.
 
Back
Top