Search This Blog

Monday, June 1, 2009

Displaying Concatenated Columns in a Calendar View

Displaying Concatenated Columns in a Calendar View

Sometimes, the need to display columns that contain values from other

existing columns in a SharePoint List arises. For those times, a quick and easy

solution is to create a calculated column that will contain the columns we desire

to display.


A real world example for using a Calculated Column that comes to mind is in a

Calendar View ListItem: Merging the Title Column with the Date and Time of the ListItem.

This can easily be accomplished by creating a calculated column that concatenates the

values in those columns.


For this example, we will assume you already created a standard Calendar List. Under the

Calendar List Settings of your List:

  • Click Create column
  • Set the Column name: to: TitleAndDate
  • Select the Calculated (calculated based on other columns) Radio Button
  • In the Formula: Text Box type:

=Title & " " & TEXT([Start Time],"mmm-dd-yyyy")

  • Select the Single line of text Radio Button for The data type to be returned from this formula is:
  • Click OK Button

In order to displaying the newly created TitleAndDate Column in the Calendar View, we

must modify the Calendar Columns View and set:

  • Month View Title
  • Week View Title
  • Day View Title

DropDowns to: TitleAndDate

  • Click OK Button

The end result will display the Title and the Start Date separated by a space.


Reviewing the Formula

The magic occurs in the TEXT function that converts the Start Time Column into text,

followed by the text being formatted into "mmm-dd-yyyy".


In case you need to add the time, just replace "mmm-dd-yyyy" with "mmm-dd-yyyy HH:MM:SS".


No comments:

Post a Comment