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 (April 1999)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 Apr 1999 19:04:34 -0500
Reply-To:     Neila Nessa <neilanessa@MSN.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From:         Neila Nessa <neilanessa@MSN.COM>
Subject:      Re: Bug in the Select If Statement

Claudio Capone wrote in message ... Hello,

I just discovered that the following syntax was not performing as I had expected it to.

FILTER OFF. USE ALL. SELECT IF(visit_date >= DATE.MDY(1,1,1999) & visit_date <= DATE.MDY(3,31,1999)). EXECUTE .

It drops any records with the date of 3/31/1999. I thought <= includes the date. Can anyone tell me why this might be happening?

Thanks in advance for your help.

Claudio A. Capone Data Analyst Value Enhancement Team Hartford Hospital ccapone@harthosp.org

Claudio , I bet you have a time included in this Date??? Neila

DATA LIST FREE / M D Y. BEGIN DATA 1 1 1998 1 1 1999 12 31 1999 3 31 1999 4 1 1999 end data . compute visdate = date.mdy(m,d,y) . SELECT IF visdate >= DATE.MDY(1,1,1999) & visdate <= DATE.MDY(3,31,1999) . LIST .

** ADD A TIME PART TO THE DATE TO VERIFY HYPOTHESIS ** . DATA LIST FREE / M D Y. BEGIN DATA 1 1 1998 1 1 1999 12 31 1999 3 31 1999 4 1 1999 end data . compute visdate = date.mdy(m,d,y) + 43200 . SELECT IF visdate >= DATE.MDY(1,1,1999) & visdate <= DATE.MDY(3,31,1999) . LIST .

** FIX THE THING WITH XDATE...... DATA LIST FREE / M D Y. BEGIN DATA 1 1 1998 1 1 1999 12 31 1999 3 31 1999 4 1 1999 end data . compute visdate = date.mdy(m,d,y) + 43200 . SELECT IF Xdate.Date(visdate) >= DATE.MDY(1,1,1999) & Xdate.Date(visdate) <= DATE.MDY(3,31,1999) . LIST .


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