Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Non Queried Date Parameter 1

Status
Not open for further replies.
Jun 23, 2008
55
GB
I have report that looks for data recorded within a School Term.

I have parameter StartDate and EndDate and want to specifythe exact dates for each term. So my Data Type is DateTime and I have set Non Queried Available values.

e.g. For StartDate

Label Value
Autumn Term 2009 03/09/2009 00:00:49

and For EndDate
Label Value
Autumn Term 2009 18/12/2009 00:00:49

I've set the query to look for records between the start and end dates.

when I try to run the report I get the message

"The property 'ValidValue' of report parameter 'StartDate' doesn't have the expected type.

I tried to correct this by setting the Parameter DataType to String which allows the report to run but it does not apply the date parameters and I get all results regardless of date.

I could do this in Crystal, is there anyway to do so in SSRS?

Thanks
Annie x
 
1st thing you might want to try is setting the date values as yyyy-mm-dd format

if that doesn't work, keep it as string and convert the string to a date within your SQL query / stored proc


WHERE TheDate BETWEEN CONVERT(datetime, @StartDate,103) AND CONVERT(datetime, @EndDate,103)

or whichever datetime conversion you need to use...think 103 is dd/mm/yyyy

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Yes! [thumbsup]

I used the Convert and it works great
Thank you so very much Geoff, you're a star! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top