Calculate Age

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

Calculate Age

Albert Calhoun
How would i calculate age in the following format:
02-Nov-1990 as of the following date 15-Oct-2012

=====================
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: Calculate Age

Maguin, Eugene
Look at the DateDiff function, which is available, I expect, as part of the Compute menu  and also documented in the help file and the syntax reference.
DateDiff is the new way and has more flexibility. One old way, which gives age in years and decimal parts, is
Compute age=(date1-date2)/(3600*24*365.25).
Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Albert Calhoun
Sent: Thursday, November 29, 2012 4:48 PM
To: [hidden email]
Subject: Calculate Age

How would i calculate age in the following format:
02-Nov-1990 as of the following date 15-Oct-2012

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Calculate Age

Bruce Weaver
Administrator
Adding to Gene's advice, in the Transform - Compute dialog, click on Date Arithmetic in the Function Group box, and Datediff will be listed in the Functions and Special Variables box.  Click on it for more info.


Maguin, Eugene wrote
Look at the DateDiff function, which is available, I expect, as part of the Compute menu  and also documented in the help file and the syntax reference.
DateDiff is the new way and has more flexibility. One old way, which gives age in years and decimal parts, is
Compute age=(date1-date2)/(3600*24*365.25).
Gene Maguin

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Albert Calhoun
Sent: Thursday, November 29, 2012 4:48 PM
To: [hidden email]
Subject: Calculate Age

How would i calculate age in the following format:
02-Nov-1990 as of the following date 15-Oct-2012

=====================
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
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Automatic reply: [SPSSX-L] Calculate Age

Cleland, Patricia (EDU)
I am out of the office until December 4  and will not be checking my emails. If your issue is urgent, please contact Caroline Rodrigues ([hidden email]) Otherwise I will reply when I return.

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