Tuesday, 17 August 2010

Date formatting in Sql server reporting services

When we work with reporting services, we come across with different requirements to display the date in different formats. So, we need to know the formats we can give to get required value. Sql server reporting services supports different formats as T-sql and C# does. So, I just want to give the valid formats I use to display the date in required format.

  1. =Format(Fields!DateCreated.Value, "M/d/yy") - 3/14/1986
  2. =Format(Fields!DateCreated.Value, "d-MMMM-yy") - 14-March-86
  3. =Format(Fields!DateCreated.Value, "MM/dd/yyyy") - 03/14/1986
  4. =Format(Fields!DateCreated.Value, "M/d/yyyy H:mm") - 3/14/1986 22:10
  5. =Format(Fields!DateCreated.Value, "dd-MMM-yyyy") - 14-March-1986
  6. =Format(Fields!DateCreated.Value, "MMM-dd-yyyy") - Mar-14-1986
  7. =Format(Fields!DateCreated.Value,"dd-MMM-yy") - 14-Mar-86

You can try different combinations of above to get desired output. Hope this helps and love to hear the comments

No comments:

Post a Comment