Link to home
Start Free TrialLog in
Avatar of sqlcurious
sqlcuriousFlag for United States of America

asked on

Trying to change time format in SSRS

Hi Experts, I tried to change the format of the date for ex: '2001-08-21 00:00:00.000' in the stored procedure by doing convert function. It works fine when I execute the sp but when I look at the report it still shows '2001-08-21 00:00:00.000' format.
So, I tried changing in the report under Expr->Common functions->date time -> FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate), though its working for all the dates but then the null values are coming out to be '1/1/0001', I am not understanding that, can you please help.
Thanks
ASKER CERTIFIED SOLUTION
Avatar of itcouple
itcouple
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sqlcurious

ASKER

Hi PatelAlpesh and itcouple, thanks for the answers, I am giving equal points for both.
As Alpesh gave the full expression icouple mentioned about the double quotes. So, the answer that
worked for me was:
=IIF(ISnothing(Field.Value), " ",FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate))
thanks