Solved

SharePoint - Outstanding days

Posted on 2011-09-09
10
770 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
  • 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
 
LVL 42

Assisted Solution

by:zephyr_hex
zephyr_hex 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 42

Assisted Solution

by:zephyr_hex
zephyr_hex 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now