|Date: ||Tue, 23 Sep 2008 11:12:44 +0100|
|Reply-To: ||Muir Houston <email@example.com>|
|Sender: ||"SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>|
|From: ||Muir Houston <firstname.lastname@example.org>|
|Subject: ||Re: Date format|
|Content-Type: ||text/plain; charset="iso-8859-1"|
your solution worked fine - and you interpreted what I wanted - a date variable
Dr Muir Houston
Faculty of Education
University of Glasgow
From: Art Kendall [mailto:Art@DrKendall.org]
Sent: Mon 22/09/2008 13:37
To: Muir Houston
Subject: Re: Date format
I assumed that you wanted a date variable,and that inserting the
punctuation was just a step toward that. If not please reply, it is
also possible to create a string variable that people will read as a
date, but will not be a date variable.
try something like this untested syntax, be sure to double check the
You may want the date variable to be displayed in a format other than
numeric myday mymonth myyear (f2).
compute myday = number(substr(olddate,1,2),f2).
compute mymonth = number(substr(olddate,3,2),f2).
compute myyear = number(substr(olddate,5,2),f2).
numeric newdate (date10).
compute newdate = date.dmy(myday,mymonth,myyear).
Social Research Consultants
Muir Houston wrote:
> Hi Listers
> Trying to use a date format - the excel file I am importing has two
> fields which contain dates in a ddmmyy format - however, there are no
> spaces or punctuation between dd mm and yy
> Is the best way to insert a '.' or '/' between parts of the string or is
> there another way
> I tried using the GUI to change to one of the date formats offered, but
> succeeded only in wiping out the data - so shut down and open again
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (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
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command