Solved

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

Posted on 2012-03-12
5
10,433 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
  • 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

Suggested Solutions

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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