Sorry, we can’t seem to find that page.
The URL may have changed, expired or never existed in the first place. If you copied it or typed it in, double check that you entered what you wanted to.
I have a date and time variable ‘Received’ written as follows: “01/09/2015-09:40:21″(string variable).
Using “Date/time wizard”, I can only create a variable containing the date. It does not recognize time, unfortunately I also need this.
I tried the following:
I used “Compute variable” with the subtract function in several ways, for instance CHAR.SUBSTR(Received,12,8), but then I get the message:
“Invalid combination of data types in an assignment. Character strings may only be assigned to string variables. Numeric and logical quantities may only be assigned to numeric variables. Use the STRING command to declare new string variables before assigning values to them or consider using the STRING or NUMBER function”
In “Compute Variable” I tried to use the STRING and NUMBER function such as test=STRING(Received, F4) without effect.
I replaced the /, : and – signs and repeated above methods, but that does not solve the issue.
Though little experienced with syntax, I tried the following afterwards:
ALTER TYPE Received (A19).
COMPUTE num = NUMBER(SUBSTR(Received,8,6),f4) .
Does not work.
Can you give advice how to get a variable that recognizes the time?
DO IF (EmotminusMeanE 0 AND PmotminusPmean>0 AND LmotminusmeanL>0).
COMPUTE E_cat = 8.
ELSE IF (PmotminusPmean>0 AND LmotminusmeanL0 AND EmotminusMeanE 0 AND LmotminusmeanL>0 AND EmotminusMeanE 0 AND PmotminusPmean 0 AND PmotminusPmean>0 AND LmotminusmeanL0 AND LmotminusmeanL>0 AND PmotminusPmean
I have different variables which are string that I am trying to recode into one new variable (0,1). When I try the function of recode variables, it won’t let me give the same new variable name to more than one input variable even though the whole goal is to have them all recoded into this same new variable. Help!