Solved

SharePoint - Outstanding days

Posted on 2011-09-09
10
782 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 (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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 42

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sharrepoint 2010 DB size 2 32
OneNote and SharePoint 10 58
Anchor text-decoration on a MasterPage 7 53
SharePoint Online Adding A People Picker to Search 14 47
A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

20 Experts available now in Live!

Get 1:1 Help Now