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