Re: How to calculate time difference (minutes) in syntax?
Posted by
David Marso on
Dec 09, 2013; 4:57pm
URL: http://spssx-discussion.165.s1.nabble.com/How-to-calculate-time-difference-minutes-in-syntax-tp5723526p5723533.html
Is it a 5 day week? Do holidays count? Some things to think about.
You are on the right track mostly with CTIME but there will be a bit more logic which to consider.
eg opened time later than closed time.
See also DATEDIFF function .
This sort of question has definitely been addressed in the archives of this list so
I encourage you to search.
rtdammann wrote
The data comes as dd/mm/yyyy hh:mm in one column.
Opened_date = 7/2/2013 11:37
Closed_date = 7/8/2013 14:32
Compute days = CTIME.DAYS (Closed_Date - Opened_Date).
Execute.
Compute time = CTIME.MINUTES (Closed_time - Opened_time).
execute.
Compute daily_minutes = days*160. (because its a 9 hour day)
Compute abs_time = abs(time).
Execute.
COMPUTE Total_Minutes=Daily_Minutes + Abs_Time.
EXECUTE.
Any help would be appreciated.
Thanks
Ross
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"