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 provision a list in SharePoint 2010 with two date fields: one for a start date and one for an end date. I would like to add a third column for the duration.

Naturally, I could add a calculated column which uses the DATEDIF function. The problem is that my date fields get their names from a resource file. It appears that calculated columns refer to other columns by their display name. Is there any way around that? I'd hate to have to add an event receiver just for this.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Just to share, I have found a workaround for this issue here: http://www.hezser.de/blog/archive/2008/10/12/programmatically-creating-a-spfieldcalculated.aspx

In short, you make the calculated column like this:

  • Save the value of web.Locale
  • Set web.Locale to English
  • Create the calculated column using English formula
  • Set web.Locale to the original value

That way, you can approach formulas as always being in English. Saves a LOT of headache

share|improve this answer
add comment

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.