07-09-2015 02:01 PM
I have to following Excel data with start and end time.
|Time task opened||Time task completed|
Calculating the time difference don't return any value in the first observation, can anyone tell me why? Here is the code I wrote.
Also how do I make additional column (let's say Total_time) where Total_Sec will show as minute (eg: 00:04:05)
07-09-2015 02:36 PM
I tried INTCK before with the following code, but it doesn't work for me (I get the same output). Do you see in my output how Total_Sec is quite incorrect. Would you be able to answer why this happen if you know of.
Diff = INTCK('second',Time_task_opened,Time_task_completed);
07-09-2015 02:47 PM
You lines are out of order. Your set statement has to come before you reference any variables. It should be like this:
07-09-2015 02:23 PM
I have the time so I did it but I agree with Miquel, you should definitely look up intck and intnx:
infile cards dsd;
informat opened completed time.;
format opened completed time.;
input opened completed;
total_sec = intck('second',opened,completed);
Although when I run your code I get the same answer. The reason you want to use intck and intnx is if you are changing the 'second' to minute day or month.
This works for me:
If it doesn't work for you you might want to check the data quality of that first line.