Error querying between dates with parameters

I know, the title is hard to explain but I will try....

In SSRS 2005 I have a lenghty query that has paramters for a @startdate and an @enddate. I use this in the query in the where statement like

eventtime between @startdate and @enddate

If I run the query and get promted for the the @startdate and @enddate but it then fails with an error:

            An error occurered while executing the query.
            Conversion failed when converting the nvarchar value '04/01/2012' to data type int.

The query works fine if I declare the @startdate and @enddate and then
set the @startdate and @enddate with the same values in the query. But if I declare the then I don't get prompted.

Any ideas?
edrz01Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kyle AbrahamsSenior .Net DeveloperCommented:
Change the parameter type to date time in your report.
0
edrz01Author Commented:
Already is. The problem is when I test the query it fails, when I run from the preview it works. I need it to work within the query test first so i verify what information it is pulling.
0
Kyle AbrahamsSenior .Net DeveloperCommented:
Are there other parameters?  Verify you're passing the parameters correctly and in the proper order.
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

edrz01Author Commented:
Thanks ged325, I have thoroughly done that before I posted.
0
Kyle AbrahamsSenior .Net DeveloperCommented:
There's a parameter mismatch of some kind going on.  Can you post your parameters and the procedure?  Also did you confirm you're pointing at the right database?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
edrz01Author Commented:
ok
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSRS

From novice to tech pro — start learning today.