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
Solved

How to subtract dates in SharePoint 2007 columns?

Posted on 2013-05-15
8
768 Views
Last Modified: 2013-05-15
Dear EE experts,

We would like to ask on how to subtract dates in SharePoint 2007 columns? We would like to get the total number of Years/Months/Days that the staff worked in the company.
We have:
3 Columns
- Date Start
- current date
- Total years in work

If we subtract the 'Current date' column to 'date start' column, it will give us different date...

What we want to happen is something like:
= Current date - Date start
= May 15, 2013 - January 2, 2007
then it should give us 6yrs, 5months, & ...

thank you in advance & hope to hear soon...
0
Comment
Question by:Stiebel Eltron
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:Haresh Nikumbh
ID: 39167522
have you check this ?

well i am not share point expert but following link may work for above requirement.

http://office.microsoft.com/en-in/windows-sharepoint-services-help/examples-of-common-formulas-HA001160947.aspx
0
 

Author Comment

by:Stiebel Eltron
ID: 39167528
@takecoffe, yes, but we didn't get any possible solution for our query... :(
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 39167552
Hi,
here we go:
=DATEDIF([Date start], [Current date], "y") & " yrs, " & DATEDIF([Date start], [Current date], "ym") & " months and " & DATEDIF([Date start], [Current date], "md") & " days"

Open in new window

0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 44

Assisted Solution

by:Rainer Jeschor
Rainer Jeschor earned 500 total points
ID: 39168014
And thats how it looks like:
Sample data - resultsHTH
Rainer
0
 
LVL 22

Expert Comment

by:Haresh Nikumbh
ID: 39168024
Cool
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39168246
One question for me: how do you get the current date?
[TODAY] does not work in calculated columns and the famous hack with a TODAY column is useless as the value will only be calculated when the record is modified.
Thanks.
Rainer
0
 

Author Comment

by:Stiebel Eltron
ID: 39170237
@RainerJ: We're about to ask that question, regarding 'TODAY' column. it's not updating automatically, it's so annoying but what we're doing is we go inside that 'TODAY' column we don't do anything, we just click 'OK' then it will update the today's date... but we're still searching for a solution that will update that 'TODAY' column automatically... hope there is... :)
0
 

Author Closing Comment

by:Stiebel Eltron
ID: 39170239
Thank you so much RainerJ! That is what we need... :)
but we need to search for the 'TODAY' column, that will update automatically...
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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

840 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