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 (July 1996)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 29 Jul 1996 14:32:31 GMT
Reply-To:   David Nichols <nichols@SPSS.COM>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From:   David Nichols <nichols@SPSS.COM>
Organization:   SPSS, Inc.
Subject:   Re: Subtracting dates

In article <4ti3bc$b2n@lyra.csx.cam.ac.uk>, K. Kafetsios <kk205@cus.cam.ac.uk> wrote: >Have two variables in date format (day,month) and want to subtract the number of days between the two. Read the functions list but had difficulty finding a relevant function. Any ideas ?

COMPUTE NEWVAR=CTIME.DAYS(VAR2-VAR1).

You can also take the difference and divide by 86,400, the number of seconds in a day, since dates are stored internally in seconds since the beginning of the Gregorian calendar.

-- ----------------------------------------------------------------------------- David Nichols Senior Support Statistician SPSS, Inc. Phone: (312) 329-3684 Internet: nichols@spss.com Fax: (312) 329-3668 -----------------------------------------------------------------------------


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