Answered by:
SRSS format codes?

Question
-
Where are these documented? Another post claims this link has them:
http://msdn2.microsoft.com/en-us/library/ms157406.aspx
But there is no list there. For instance "d" gives M/d/yyyy format for dates, but how about MM/dd/yyyy or MMM/dd? Also are there formatting codes for currency?Wednesday, November 18, 2009 11:17 PM
Answers
-
Reporting Services uses the .NET format codes.
Here are links to numeric and date time .NET format codes:
Standard numeric format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp
Custom numeric format string:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
Standard datetime format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp
Custom datetime format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomdatetimeformatstrings.asp
HTH,
Robert
Robert Bruckner http://blogs.msdn.com/robertbruckner
This posting is provided "AS IS" with no warranties, and confers no rights.Thursday, November 19, 2009 2:35 AM
All replies
-
Reporting Services uses the .NET format codes.
Here are links to numeric and date time .NET format codes:
Standard numeric format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp
Custom numeric format string:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
Standard datetime format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandarddatetimeformatstrings.asp
Custom datetime format strings:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomdatetimeformatstrings.asp
HTH,
Robert
Robert Bruckner http://blogs.msdn.com/robertbruckner
This posting is provided "AS IS" with no warranties, and confers no rights.Thursday, November 19, 2009 2:35 AM -
Thanks. It turns out I thought the .Net formatting codes were not working because functions like First() appear to return a string, so you have to enclose them with a CType() function if you want a format code to work on them. For instance, if you wanted to set the format field to do date formatting to "MM/dd/yyyy" you need to set a textbox on your report to CDate(First(Fields!ReportDate.Value)), where Fields!ReportDate.Value is a field from one of your data sources, otherwise the Format property does not get applied correctly.Monday, November 23, 2009 2:56 PM