Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have records that are modified each month. The site is used to display the previous month's information. However, to make sure that the information is correct, I want to use the date the information is modified as the original date and retrieve the month prior to that date. Eventually I want to use the previous month to format the label dynamically.

For example, if the records are updated on March 10, 2013, I would be displaying the data from February so I want the label to say "February 2013."

Any assistance is greatly appreciated!

share|improve this question

1 Answer 1

It's going to be a great, big messy calculated column, but it can be done. There's probably better ways to do this but nothing I know how to do offhand.

New calculated column, type of Single Line of Text (String):

=IF(MONTH([MyRecordUpdated])=1, "December "&YEAR([MyRecordUpdated])-1,
IF(MONTH([MyRecordUpdated])=2, "January "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=3, "February "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=4, "March "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=5, "April "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=6, "May "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=7, "June "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=8, "July "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=9, "August "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=10, "September "&YEAR([MyRecordUpdated]),
IF(MONTH([MyRecordUpdated])=11, "October "&YEAR([MyRecordUpdated]),
"November "&YEAR([MyRecordUpdated]))))))))))))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.