Solved

SharePoint - Outstanding days

Posted on 2011-09-09
10
791 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Citrix sharefile 1 74
DataTables Form Input issue. 3 81
CMAL Query - Jsom 1 70
Is there a SharePoint setup guide for beginners? 18 61
Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
We had a requirement to extract data from a SharePoint 2010 Customer List into a CSV file and then place the CSV file into a directory on the network so that the file could be consumed by an AS400 system. I will share in Part 1 how to Extract the Da…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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