Solved

Change Date format to YYYY-MM-DD in SSRS report .

Posted on 2012-03-12
5
10,854 Views
Last Modified: 2016-02-15
Hi Gurus,

I have a report designed. The data source for this report is cube. I have a column called date in this report. The present format of the report is MM-DD-YYYY. I want that to be displayed in YYYY-MM-DD format. I played with the textbox properties and expression but it still giving me the same result. Can anyone guide me with this please.
0
Comment
Question by:HeroOfSparta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Patrick Tallarico
ID: 37712369
can you adjust the underlying query to use a converted date?

...convert(120, datefield)...

http://msdn.microsoft.com/en-us/library/ms187928.aspx
0
 

Author Comment

by:HeroOfSparta
ID: 37712377
Thanks for you reply. But I am extracting from cube and not from the table. I am not sure if I can use above query in my case. I am wrong please explain me in detail .
0
 
LVL 21

Accepted Solution

by:
Jason Yousef, MS earned 500 total points
ID: 37712520
Alright 2 ways...

The easy way.....

=Format( Fields!BadDate.Value ,"yyyy-MM-dd")

=Format(CDATE( Fields!BadDate.Value ),"yyyy-MM-dd")


The hard way.....

=Year(CDATE(Fields!BadDate.Value))&"-"&Month(CDATE(Fields!BadDate.Value))&"-"&Day(CDATE(Fields!BadDate.Value))


Also good to mention to replace "Fields!BadDate.Value" with your actual column name :)

Regards,
Jason
0
 

Author Closing Comment

by:HeroOfSparta
ID: 37714352
Thank you verymuch Jason. The expression worked out is : Incase anyone having same problem.

=Format(CDATE( Fields!BadDate.Value ),"yyyy-MM-dd")

Note: I did not tried the hard way yet. As everyone wants easy way :)
0
 
LVL 21

Expert Comment

by:Jason Yousef, MS
ID: 37714580
Glad that it helped you, see you in another SSRS question :)
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question