?
Solved

Error querying between dates with parameters

Posted on 2012-04-04
6
Medium Priority
?
296 Views
Last Modified: 2012-06-21
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?
0
Comment
Question by:edrz01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 37806761
Change the parameter type to date time in your report.
0
 

Author Comment

by:edrz01
ID: 37806789
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
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 37807582
Are there other parameters?  Verify you're passing the parameters correctly and in the proper order.
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 

Author Comment

by:edrz01
ID: 37807640
Thanks ged325, I have thoroughly done that before I posted.
0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 1500 total points
ID: 37807668
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
 

Author Closing Comment

by:edrz01
ID: 37822936
ok
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this short article I will be talking about two functions in the SQL Server Reporting Services (SSRS) function stack.  Those functions are IIF() and Switch().  And I'll be showing you how easy it is to add an Else part to the Switch function. T…
Hi All, I am here to write a simple article to move SSRS (SQL Server Reporting Services) reports from one server to another. When I have faced the same issue to move reports those were developed by developer on development server and now need to …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question