Problem with my first SSRS report

  • After fumbling along to figure out how to get parameters to come up to ask for a start and end dates, I'm able to run the report but it's coming up blank (no data).

    When I hard code the dates into the SQL script, I get information just fine and it looks like a good report. When I try to use parameters, it's coming up with no data.

    I'm using BIDS 2005, with an OLE DB connection to a 2000 database.

    This is at the top of my script....

    declare @start datetime

    declare @end datetime

    ...and this is where I'm using the parameters....

    and vpb110.pmt_app_ts >= @start

    and vpb110.pmt_app_ts <= CASE WHEN @start = @end THEN DATEADD(dd, 1, @end) ELSE @end END I keyed both start and end information in the Report Parameters (Report-->Report Parameters) and I keyed the information into the Parameters tab within the dataset.

    Any words of advice? I can provide more information if necessary.

  • Using OLEDB the parameter character is a ?. So your query should look like this:

    Select

    *

    From

    vpb110.pmt_app_ts >= ?

    and vpb110.pmt_app_ts <= CASE WHEN ? = ? THEN DATEADD(dd, 1, ?) ELSE ? END

    Also if you are using the native client and a query within the report you do not declare your parameters you just put them in with the @. Declaring them in SQL in the report does not allow the report parameter to be assigned to the query parameter.

  • Thanks Jack. Your answer got me started. You lost me on what you said after the corrected code. I'm new to SSRS and I wasn't sure how you designated each question mark. Niels entry helped me finish and now my report works great.

    http://www.sqlservercentral.com/Forums/Topic454447-150-1.aspx

    Thanks for getting me started in the right direction.

    🙂

  • in the report check your report parameters, make sure that they are there and as you want them. It sounds like the dates are embedded there, make them nulls.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply