Date: Wed, 12 Jul 2006 10:58:59 -0400
Reply-To: Edward Boadi <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Edward Boadi <email@example.com>
Subject: Re: Transforming date variables
Content-Type: text/plain; charset="iso-8859-1"
Compute Var_Year = number(substr(Date_var,1,4)).
Compute Var_Month = number(substr(Date_var,5,2)).
Compute Var_Day = number(substr(Date_var,7,2)).
Compute New_Date = DATE.MDY(Var_Month,Var_Day,Var_Year).
FORMATS New_Date (ADATE10).
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
Sent: Wednesday, July 12, 2006 10:25 AM
Subject: Transforming date variables
Another small question - I am working with spss 14 and using the date
function. I have a variable imported from Excel that is a date but it is
in a numeric format. I want to make it a recognized date variable in
spss. For July 25, 2006 the value appears as 20060725. Using the
date/time wizard it appears easiest to transform a variable that is a
string. I want to do this in the syntax but I can't figure out how. This
means that I have to go back to the data window and change it to a string
manually. I am sure this is easy to do but I have been through the manual
section on formats with no luck...