Solved

SharePoint - Outstanding days

Posted on 2011-09-09
10
809 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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