Thanks for your answer but it is displaying the dates in a combobox for the user to choose; not quite what I need.
In my situation the date entry is free form and entered into a text box. The problem is the user enters, say, "11/07/2005" and when the report executes Reporting Services displays the entered date at "11/07/2005 12:00 AM". I want to NOT display the "12:00 AM".
Main Topics
Browse All Topics





by: simon_kirkPosted on 2005-11-07 at 01:58:45ID: 15237663
Hi,
This example assumes your date fields have no specific time, i.e. they are all 12:00AM.
For some of my reports I create a parameter dataset based on the table holding the dates.
SELECT DATENAME(day, MyDateField) + ' ' + DATENAME(month, MyDateField) + ' ' + DATENAME(year, MyDateField) AS Label, MyDateField AS Value
FROM MyTable
GROUP BY DATENAME(day, MyDateField) + ' ' + DATENAME(month, MyDateField) + ' ' + DATENAME(year, MyDateField), MyDateField
ORDER BY MyDateField
This creates 2 fields, 'Label' which is what the user selects from and 'Value' which the dataset uses to query on.
Create a parameter (@MyParameterDate) and reference it against your main dataset e.g.
SELECT * FROM MyTable WHERE MyDateField = @MyParameterDate
In your Report parameters set the values to be from a query and select your parameter dataset. Set the Value and Label datafields to the ones created above and ensure the parameter datatype is DateTime. You can change the above format if you don't want dates displaying as '7 November 2005'.
HTH