sql help

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
 
T

Thomas A. Rowe

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.
==============================================
 
T

Thomas A. Rowe

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


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top