1
votes

Im currently working on a report in SQL 2005 and am pretty new to reports. I am using a "Start Date" and "End Date" for a user to select a reporting period.

For my "Start Date" I am using a Report Parameter "Default" value of:

=DateSerial(Year(Today()),Month(Today()),Day(Today()))

For my "End Date" I am using a ReportParameter Defulat value of:

=Now()

The user is displayed the following:

  • Start Date: 06/01/2012
  • End Date: 01/01/2012 12:33:03

PROBLEM: - I would like to DISPLAY the default time from the DateSerial function to the user (which is defaulted to midnight 00:00:00). Im just curious if this is possible in SQL 2005.

1
I have figured this out. In the Report Parameters dialog i had accidentally checked the "Allow blank values" checkbox. Unchecking this shows my dates as expected. I also had to set the data type to "string" and then i used the following non-queried value: =Format(now,"MM/dd/yyyy hh:mm tt")AlpineCoder

1 Answers

3
votes

If time is not relevant to your query (e.g. the data you are querying only uses dates and not time) the 'End Date' parameter default could be changed to "=Today()"

The "Today()" function provides the current date only, if used in a type that supports time as well, the 'default' time of 12:00:00 AM will be show.

Expression Examples (Report Builder and SSRS)