Solved

How to subtract dates in SharePoint 2007 columns?

Posted on 2013-05-15
8
759 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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…

770 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