subtracting two dates

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

subtracting two dates

E. Bernardo
I did some searching from the archive but unfortunately I got nothing related to what I want.

  Dates when employees were hired were recorded in this form: mm/dd/yyyy.. From that I want to compute the number of years since employees were hired.  I am thankful if somebody would help provide a syntax.

  Eins


---------------------------------
  Importing contacts has never been easier..
Bring your friends over to Yahoo! Mail today!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: subtracting two dates

Daciuk, Tim
data list /start (adate10).
BEGIN DATA
12/12/1988
8/31/2007
6/23/1999
end data.
COMPUTE  Diff=DATEDIF($TIME, start, "years").

EXECUTE.

Tim Daciuk
Director, Worldwide Demo Resources
SPSS Inc.




-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Eins Bernardo
Sent: Monday, January 19, 2009 8:46 AM
To: [hidden email]
Subject: subtracting two dates

I did some searching from the archive but unfortunately I got nothing related to what I want.

  Dates when employees were hired were recorded in this form: mm/dd/yyyy.. From that I want to compute the number of years since employees were hired.  I am thankful if somebody would help provide a syntax.

  Eins


---------------------------------
  Importing contacts has never been easier..
Bring your friends over to Yahoo! Mail today!

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD