Formatting a date in an MDX query
- Joel Lipman
- Transact-SQL
- Hits: 22784
=FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate)
The other formats are:
=FormatDateTime(Fields!BirthDate.Value, DateFormat.GeneralDate) =FormatDateTime(Fields!BirthDate.Value, DateFormat.LongDate) =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate) =FormatDateTime(Fields!BirthDate.Value, DateFormat.LongTime) =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortTime)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.GeneralDate)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.LongDate)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortDate)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.LongTime)
- =FormatDateTime(Fields!BirthDate.Value, DateFormat.ShortTime)
Unfortunately if you are using US dates and want the report to use a specific European date format and you spend as long as I did searching the web for a solution, then ignore all the above.
Another built-in function is the text-formatter