I am trying to code a new variable that uses a date field so that if entries have a date greater than x, they get a 1 and less than that date they get a 0. I am doing this under Transform/Compute
I have tried to create an if statement where it equals:
if
date_var >= 11/07/2012
then target var =1
When I do this, it makes all values in the field 1.... So either the date variable is messed up , or I am not properly defining the date in the if statement? Is there some syntax that I am missing when trying to look for a specific date? I do not believe that the date field is at fault as I am able to successfully extract other data such as year and month from that field. I have searched everywhere online for this solution! Thanks in advance!!
I have tried to create an if statement where it equals:
if
date_var >= 11/07/2012
then target var =1
When I do this, it makes all values in the field 1.... So either the date variable is messed up , or I am not properly defining the date in the if statement? Is there some syntax that I am missing when trying to look for a specific date? I do not believe that the date field is at fault as I am able to successfully extract other data such as year and month from that field. I have searched everywhere online for this solution! Thanks in advance!!