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 need a calculated column to display "Yes" if the current time is more than 3 hours after the value of another column. This is what I've come up with:

=TEXT(Today-[AddTime],"h")>3

But SP tells me this is invalid. Are there other ways of doing this?

Larsi

share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

As you google around for this you are going to come across pages telling you you can do this with calculated columns using the [Today] trick.

You can't, it doesn't work and isn't updated dynamically - and even if it were [Today] doesn't include a time component so X hrs is out.

A couple of options for you

share|improve this answer
add comment

You may want to look at this, it's a good primer for calculated columns. Also, Today and Me are not allowed in calculated columns.

share|improve this answer
    
Handy link, I've included it in the tag wiki (to be approved): sharepoint.stackexchange.com/tags/calculated-column/info –  Stuart Pegg Apr 15 '11 at 9:50
add comment

Excuse my self-promotion, but:

We've developed a custom column that can do just that, which is currently in Public Beta: http://www.pentalogic.net/sharepoint-products/highlighter/beta-testers-guide

To set it up to do this, you'd choose:

  • Highlighting
  • Display: Cell highlighting
  • Rules: Click "Add custom", then add the following two rules:

Rules example

share|improve this answer
add comment

This can likely be implemented not in a calculated column but in a computed column. The difference being that a calculated column is only calculated during edits, and a computed column for each render.

Wouter

share|improve this answer
1  
I'm curious as to how one would implement a custom Computed column at all, to be honest. I was under the impression you'd have to inherit from SPFieldComputed, which is uninheritable. –  Stuart Pegg Apr 15 '11 at 9:25
    
You don't develop a computed column, you only configure it. E.g. <Field Type="Computed"> and then use the render pattern to define the UI –  Wouter - SharePoint MVP Apr 19 '11 at 12:53
    
Oh, I understand. However, you don't have to use Computed in that instance, and I haven't come across a calculation-friendly version of ThreadStamp in the View Schema so far. –  Stuart Pegg Apr 19 '11 at 14:01
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.