Selection of cases based on date variable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Selection of cases based on date variable

aschoff

Hello,

i have a simple question about the selection of cases based on a date variable. I have data collected every day for the last three month. I would like to select cases based on the date variable (e.g. select only those cases between March 3rd and 7th.). I just cant make it work somehow. Among other things I tried "Select Cases / Based on time or case range" but I dont understand the input format that is needed for these fields.

Thanks alot,
Robinson
--------------------------------------------------------------------------------
Felix-Robinson Aschoff
Department of Informatics
University of Zurich
Binzmuehlestrasse 14
CH-8050 Zurich, Switzerland

E-Mail: [hidden email]
Phone: +41 (0)44 635 6690
Fax: +41 (0)44 635 6809
Room: 2.D.11
http://www.ifi.uzh.ch/im

Reply | Threaded
Open this post in threaded view
|

Re: Selection of cases based on date variable

ariel barak
Hi Robinson,
 
I don't use the GUI for selecting cases, so I can't help you with that. But here is some syntax that you can alter and use as needed. In order for the syntax below to work, the variables must be formated as date variables.
 
SELECT IF DateVariable>=DATE.MDY(3,3,2009) AND DateVariable<=DATE.MDY(3,7,2009).
EXE.
 
This will drop all cases outside of these dates. If you are intersted in summary statistics, you can use the temp command.
 
TEMP.
SELECT IF DateVariable>=DATE.MDY(3,3,2009 AND DateVariable<=DATE.MDY(3,7,2009).
CROSSTABS Variable1 BY Variable2.
 
Good luck,
Ariel

On Mon, May 11, 2009 at 10:35 AM, <[hidden email]> wrote:

Hello,

i have a simple question about the selection of cases based on a date variable. I have data collected every day for the last three month. I would like to select cases based on the date variable (e.g. select only those cases between March 3rd and 7th.). I just cant make it work somehow. Among other things I tried "Select Cases / Based on time or case range" but I dont understand the input format that is needed for these fields.

Thanks alot,
Robinson
--------------------------------------------------------------------------------
Felix-Robinson Aschoff
Department of Informatics
University of Zurich
Binzmuehlestrasse 14
CH-8050 Zurich, Switzerland

E-Mail: [hidden email]
Phone: +41 (0)44 635 6690
Fax: +41 (0)44 635 6809
Room: 2.D.11
http://www.ifi.uzh.ch/im