I posted this in the dreamweaver form for you also.
Try this in your sql statement,
SELECT *
FROM tblCerts
WHERE Type LIKE ParamType AND Surname LIKE %ParamSurname%
AND FirstNames
LIKE %ParamFirstNames% AND ((Year([EventDate])) LIKE
#ParamYear#)
Dave
"Vix" <user@example.net> wrote in message
news:eaq9fu$t0g$1@forums.macromedia.com...
> I'm building a search page in ASP which will look at a
specific table in
> an Access database. The users can search with different
criteria.
>
> The table has a date field, which will contain people's
date of birth.
>
> In the search box I'd like the user to be able to search
for anyone that
> was born in 1930 for example. They'll just type a year
into the form
field.
>
> However on my results page I'm getting the error message
"Application
> uses a value of the wrong type for the current
operation." The line it
> refers to is
>
> rsResults_cmd.Parameters.Append
rsResults_cmd.CreateParameter("param4",
> 135, 1, -1, rsResults__ParamYear) ' adDBTimeStamp
>
> the sql for the query is:
>
> SELECT *
> FROM tblCerts
> WHERE Type LIKE ParamType AND Surname LIKE
%ParamSurname% AND FirstNames
> LIKE %ParamFirstNames% AND ((Year([EventDate])) LIKE
ParamYear)
>
> I can put in a default year and click the test button in
the recordset
> dialog box and the correct records are returned. But on
the page itself
> I get the error message.
>
> Please could someone tell me where I've gone wrong.
> Thanks
>
> Vix