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 (September 2007)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 6 Sep 2007 06:46:23 -0500
Reply-To:     "Fry, Jonathan B." <jfry@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Fry, Jonathan B." <jfry@SPSS.COM>
Subject:      Re: seeking help in calculating number of days
Comments: To: Thara Vardhan <vard1tha@police.nsw.gov.au>
In-Reply-To:  A<OFA3A071A4.2BE9E2E1-ONCA25734E.0020719D-CA25734E.00207073@police.nsw.gov.au>
Content-Type: text/plain; charset="us-ascii"

The trick here is to create a variable that does have a value in each row.

It appears there are multiple events but only one intimidationdate for each personci. If that is always the case, you can create the variable you need (call it intimidationdate2) with the command

Aggregate /break=personci/ intimidationdate2 = first(intimidationdate).

Jonathan Fry SPSS Inc.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Thara Vardhan Sent: Thursday, September 06, 2007 12:55 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: seeking help in calculating number of days

Dear List Members

I would be grateful if anyone could help me calculate the number of days between the 2 dates - "Eventdate" and "Intimidation date". I have tried using the date diff function and it works but it only calculates where there are values in the two columns.

What I need to calculate is the number of days between each eventdate and intimidationdate for each personcni.

Personcni eventdate intimidationdate xyz 13-APR-2004 13-APR-2004 abc 06-JUN-2006 06-JUN-2006 hij 22-JUL-2003 . hij 22-JUL-2003 . hij 23-NOV-2003 . hij 27-NOV-2004 . hij 24-OCT-2005 24-OCT-2005 hij 17-MAR-2006 . hij 17-MAR-2006 . lop 01-OCT-2005 . lop 14-DEC-2005 . lop 08-APR-2006 08-APR-2006 efg 06-SEP-2005 . efg 06-SEP-2005 06-SEP-2005 aks 05-FEB-2005 . aks 05-FEB-2005 05-FEB-2005 aks 19-APR-2005 . stu 27-APR-2004 27-APR-2004 stu 27-FEB-2006 . stu 02-NOV-2003 02-NOV-2003

Thanks regards Thara Vardhan Senior Statistician Planning & Results Organisation Review and Support NSW Police Tel: (02) 8835-8526

Thara Vardhan Senior Statistician Planning & Results Organisation Review and Support NSW Police Tel: (02) 8835-8526

This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have received it by mistake, please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone.


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