Solved

SharePoint - Outstanding days

Posted on 2011-09-09
10
823 Views
Last Modified: 2012-05-12
Hello all,

I'm having a problem with my code. it works for the first day but the next day it doesn't change at all. This is to show the days outstanding. If the Post date is greater than today then it will show the days outstanding. Below worked but then the next day the value stayed the same. Any help will be appreciated. Thanks

=IF(OR(ISBLANK([Post Date]),[Post Date]>Today),0,DATEDIF([Post Date],Today,"d"))
0
Comment
Question by:Isaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 14

Expert Comment

by:abhitrig
ID: 36512349
Can you try this
=IF(OR(ISBLANK([Post Date]),([Post Date]>Today)),0,[Post Date]-Today)
0
 
LVL 5

Author Comment

by:Isaac
ID: 36512670
Thanks. It seems the code is not the problem. I just realized that it is not refreshing to show the
current day outstanding. Do you know why this may occur?
0
 
LVL 14

Expert Comment

by:abhitrig
ID: 36512710
Can you create a new view to see if that helps?
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 43

Assisted Solution

by:zephyr_hex (Megan)
zephyr_hex (Megan) earned 250 total points
ID: 36513125
"today" doesn't work with sharepoint.  unless you update the record daily.

http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/
0
 
LVL 14

Expert Comment

by:abhitrig
ID: 36513455
zephyr_hex refers to a great point. Did you start by creating a column called today and then deleted it or you created a column with the default value as today?  my response is assuming that you have created a new column called today and then used it in your calc column. If not, try doing that.
0
 
LVL 43

Assisted Solution

by:zephyr_hex (Megan)
zephyr_hex (Megan) earned 250 total points
ID: 36513510
that trick does not work.

it will give you the correct value on the day that you create or update the record.  but it will be wrong tomorrow.  the article i posted explains why... but i will summarize:

sharepoint does not dynamically calculate "today".  it calculates "today" when the record is created or updated.  so if you create or update the record on 9/9/11, the value will be correct.  but when you go look at it on 9/10/11, sharepoint is still using 9/9/11 as "today", so the value is wrong.

the article i posted gives more info, and offers some workarounds.
0
 
LVL 4

Expert Comment

by:leopolde
ID: 36514604
Something you might want to try is to create two small workflows in SharePoint Designer, that basically do the following for every item:

1st Workflow (Run on new and modiefied items)
* Sleep for 24 hours
* If the item status is not "complete", then update a dummy field in the item called something like "Start 2nd Workflow" so it contains a "Yes"

2nd Workflow (Run on modified items)
* If the field "Start 2nd Workflow" is "Yes" then change it to "No".

The reason you need to workflows for this is that a workflow cannot start itself.  Remember to create the "Start 2nd Workflow" field, with a default value of "No"
0
 
LVL 5

Author Comment

by:Isaac
ID: 36514761
@zephyr_hex

You are definitely right. This is what is happening with me. Workarounds are great and the countdown is what I need but I'm not allowed to use SPD on client site. Do you know a way that I can show a countdown but for days passed? Probably using jquery?
0
 
LVL 5

Accepted Solution

by:
Isaac earned 0 total points
ID: 36514893
Thanks everyone. I found a solution for what I was looking. You might find it useful. I tweaked the following to serve my needs.

Use jQuery to add a ‘Days until Due’ column onto your SharePoint list views

http://sharepointclowns.com/2011/06/use-jquery-to-add-a-days-until-due-column-onto-your-sharepoint-list-views/
0
 
LVL 5

Author Closing Comment

by:Isaac
ID: 36534827
I needed to show the number for days outstanding and the solution I found assisted in displaying a number. I gave partial credit to @zephyr_hex because it was a solution only if you can use SPD but to fit my needs the solution I found was what I needed.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you create your solutions on SharePoint sooner or later you will come upon a request to set  permissions of the item depending on some of the item's meta-data - the author, people assigned as approvers, divisions, categories etc. The most natu…
Pimping Sharepoint 2007 without Server-Side Code Part 1 One of my biggest frustrations with Sharepoint 2007 in the corporate world is that while good-intentioned managers lock down the more interesting capabilities of Sharepoint programming in…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question