Date Parameter using a 'From Query' not working

  • Hi all,

    Ive only just got started with reporting services and Im currently going through all the tutorials for it.

    I have a dataset that has the data item Quality_Date in it. Going into properties the data type has been set up as d

    I then created another dataset against the same table to provide a list of distinct Quality Dates.

    I then went into Report - Report parameters.

    In avaliable values I choose From Query -

    DataSet Data_Quality_Dates

    Value Field Quality_Date

  • Whoops sent before I finished. Sorry about that.....

    When I go and preview the report you get the drop down list with all the distinct quality dates in it. But when you choose on it says 'The value provided for the report parameter 'Quality_date' is not valid for its type'

    Ive tried to figure out where the types are different but I cant find it. I do know that if you set the report parameter up to look at the top one under properties, you can set it up as a date time and when you preview it shows you a little calendar box that you can choose the date from and it works fine. When I go from my distinct list this doesnt happen.

    Am I missing something somewhere about setting the distinct dataset to DateTime?

    Debbie

  • Are you using only the date part of the datetime in your dataset? Something like the following:

    select distinct CONVERT(varchar(10), issueddate,101) as issueddate from table1

    If you do, set the parameter type to string rather than datetime.

  • Interesting,

    Thanks for that. I will definitely try that out. using string parameters seems to go fine. Its just the date time thing that is causing me issues.

    Debbie

  • HI

    CONVER YOUR PARAMETER TYPE AND INPUT TYPE IN TO ONE FORMAT USING THE FUNCTION "CDATE "

    for eg:

    cdate(year(fields!.Date.Value)&"-"&month(date.value))

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

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