[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2012-03-12
5
Medium Priority
?
13,142 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 2000 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

656 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