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
Microsoft SQL ServerSSRS

Avatar of undefined
Last Comment
sqlcurious
ASKER CERTIFIED SOLUTION
Avatar of itcouple
itcouple
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Alpesh Patel
Alpesh Patel
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sqlcurious
sqlcurious
Flag of United States of America image

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))
Avatar of sqlcurious
sqlcurious
Flag of United States of America image

ASKER

thanks
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo