LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (January 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 5 Jan 2006 07:26:09 -0800
Reply-To:     Nico Peruzzi <nperuzzi@gmail.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Nico Peruzzi <nperuzzi@gmail.com>
Subject:      Re: Date syntax
Comments: To: RalphG2703@aol.com
In-Reply-To:  <84.538d3935.30ee68b5@aol.com>
Content-Type: text/plain; charset=ISO-8859-1

Paula,

This might not be the most graceful way, but it should work.

Create a variable in your dataset called RefDate, and copy and paste in 2005/11/15.

Run this syntax:

COMPUTE outcome = DATEDIFF(RefDate,DOB,"years") . EXECUTE .

"outcome" is the new variable that will be created, in years. DOB is your birth date variable.

The syntax takes the differece, in years, between the reference date and the DOB.

Hope that helps, Nico

On 1/5/06, Ralph Grubb <RalphG2703@aol.com> wrote: > > Does anyone have syntax that converts a date of birth (DOB) to a reference > date, e.g., November 15, 2005? My DOB data are in this form > YYYY/MM/DD. For > example: > > 2001/06/28 > 2003/11/10 > 2000/01/01 > > Preferably I would like the calculated age or result in decimal form i.e., > 4.5 > > Thanks in advance. Paula >

-- Nico Peruzzi, Ph.D.


Back to: Top of message | Previous page | Main SPSSX-L page