Comparing dates in SPSS and highlighting not matching ones

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Le0nora
Posts: 1
Joined: Wed Aug 06, 2014 8:28 pm

Comparing dates in SPSS and highlighting not matching ones

Postby Le0nora » Wed Aug 06, 2014 8:36 pm

Hello!

I am trying to create a dataset suitable for a subquestion in my research, and i could use some help.

I've got a database consisting of about 1400 cases. All of these cases have 2 things in common.
Lets say they all bought a car and they all parked it in front of their house.

The exact date and time of the buying and the parking of the car is registered ( in two variables--> dd-month-yyy and time in 24h notation xx:xx). I want to include all people who have bought their car and parked it in front of their house within 24 hours.

Since im such a SPSSnoob, i was planning on doing this manually. If the date of the buying and parking match, there's no need for me to count out the hours. It will be within 24h. If a car is bought on 01-jan-2014 22:00 and parked on 02-jan-2014 01:30...the buyer has to be included. But if its bought on 01-jan-2014 22:00 and parked on 02-jan-2014 22:01, the owner has to be excluded.

Is there a full automatic way of doing this? Or is there a way to compare the two variables in such a way that the ones that don't match, pop up or are highlighted? This would save me so much time.

I will, ofcourse, appreciate every answer.. But i must warn you. I am an absolute SPSS nitwit. So please explain on a Bert and Ernie level :roll: ..


Thank you!


PS: I tried making date and time 1 variable (and was planning on thén finding a way to make sure theyre <24h apart) but that didnt work.
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: Comparing dates in SPSS and highlighting not matching on

Postby GerineL » Mon Aug 11, 2014 2:45 pm

Take a look at the date-time wizard, you can calculate with dates and times using this, and you can use this to compute difference in dates.
Then you select only cases with <24 hrs.

Who is online

Users browsing this forum: No registered users and 2 guests

cron