3

Is there a way to make a column in a list that updates daily with the current date? If not what's the best way to do this? I was thinking of using the 'Lookup' field to link to the calendar that's on the site with no luck.

Alls I need is a column that always has the current date.

3
  • Somebody may propose alternate way of achieving your functional requirement. If you can explain what you are trying to achieve by this column with "Current Date".
    – Amit Tyagi
    Dec 4, 2014 at 0:25
  • @AmitTyagi simply use it to calculate the number of days until a certain item has until expiration
    – PT_C
    Dec 4, 2014 at 12:52
  • Can you mark your question as answered, It keeps popping up in the Unanswered list Aug 10, 2015 at 11:06

4 Answers 4

2

Two options

  1. Create a timer job which runs daily and updates the list items
  2. Create a workflow which fires daily and updates the list items

Option 1 is straight forward and easy to implement. Option 2 don't require any deployment and you can use SharePoint Designer to achieve this, but building it is tricky.

6
  • I didn't know you could do that with workflows. I thought they has to be manually activated
    – PT_C
    Dec 3, 2014 at 20:52
  • Yes it's possible, but tricky to implement Dec 3, 2014 at 21:19
  • sharepoint.stackexchange.com/questions/15962/… explains how to set up a daily triggered workflow fairly accurately. Dec 4, 2014 at 19:47
  • @AmalHashim is there a better way to do using another feature in 2010?
    – PT_C
    Dec 9, 2014 at 13:51
  • @PT_C unfortunately no. There some be some process which goes and update this on a daily basis. Dec 9, 2014 at 13:57
1

Create a calculate column and set formula to : NOW()

This will set the field daily to today date, and then use this in other calculated columns.

1
  • This wont work as calculated columns only update when the item is updated. To use this (in the way OP wants) you would have to have a workflow that updates the item each day (such as a simple toggle field). This would then force the calculated column to recalculate
    – Roland
    Dec 15, 2016 at 0:46
0

The quick and dirty method is PowerShell and a scheduled task. Assuming your field is a date/time field. You can do any math you want in there as well. Just set it to run daily.

$web = Get-SPWeb <Web URL>
$list = $web.Lists["<List Name>"]

foreach ($item in $list.Items)
{
  $item["Current Date"] = Get-Date -format s;
  $item.Update();
}
0

Unfortunately calculated columns are calculated at the time they are filled in. Not each time the column is viewed. If you are, however, trying to do that calculation at the time the item is created you can use the following:

=TEXT([Modified],"mm-dd-yyyy hh:mm:ss")

A somewhat older but reliable article regarding time inside the calculated columns can be read here at http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/ in addition to the information I provided above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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