Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 14387
  • Last Modified:

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

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
HeroOfSparta
Asked:
HeroOfSparta
  • 2
  • 2
1 Solution
 
Patrick TallaricoFSEP Systems AnalystCommented:
can you adjust the underlying query to use a converted date?

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

http://msdn.microsoft.com/en-us/library/ms187928.aspx
0
 
HeroOfSpartaAuthor Commented:
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
 
Jason Yousef, MSSr. BI DeveloperCommented:
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
 
HeroOfSpartaAuthor Commented:
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
 
Jason Yousef, MSSr. BI DeveloperCommented:
Glad that it helped you, see you in another SSRS question :)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now