Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Exclude time value from date/time in reprt header

Author  Topic 

cwildeman
Starting Member

40 Posts

Posted - 2011-03-16 : 11:36:16
Hi,
I have two parameter from a stored procedure: @StartDate and @EndDate. I have it so the user runs a report and selects the start and end date based the discharge date. In my SSRS report header I want it to read 'Discharge Status [@StartDate] to [@EndDate]'. This works but I don't want the time to show. I tried to format them such as =Month(@StartDate) but get an error message. Any idea how to format the date in a header and exclude the time.
Chuck


Chuck W

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2011-03-16 : 11:48:06
I don't have the report environment in front of me, but I believe you can put DateFormat(@StartDate, 2) and get a shortdate format. (if that doesn't work, try the same thing with FormatDate(@StartDate, 2))

Hey, it compiles.
Go to Top of Page

cwildeman
Starting Member

40 Posts

Posted - 2011-03-16 : 13:29:26
Thanks. I am new to SSRS and am used to Access reports. I tried typeing in Discharge Status Between DateFormat(@StartDate, 2) and DateFormat(@EndDate, 2) into the report header. When I ran the report, it can out just liked I typed it (I tried FormatDate too). I then put =DateFormat(@StartDate, 2) into a text box but got an error. Do I need a text box to get this to work. Any idea what I am doing wrong? Chuck

Chuck W
Go to Top of Page
   

- Advertisement -