Re: Separate shifts within date time variable
Posted by
Bruce Weaver on
URL: http://spssx-discussion.165.s1.nabble.com/Separate-shifts-within-date-time-variable-tp5740995p5741001.html
Can you replace this line...
if (ordertime ge TIME.HMS (00,00) and ordertime le TIME.HMS (10,59)) testtime=1 .
with this?
IF RANGE(ordertime, TIME.HMS(00,00), TIME.HMS (10,59)) testtime=1 .
parisec wrote
Appreciate all of the feedback!
I extracted out the time from the date to create the ordertime variable.
The variable is HH:MM in 24 hour time.
This worked.
compute testtime = $sysmis.
if (ordertime ge TIME.HMS (00,00) and ordertime le TIME.HMS (10,59)) testtime=1 .
if (ordertime ge TIME.HMS (11,00)) testtime=2.
freq testtime.
Thank you all for your time.
Carol
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/"When all else fails, RTFM."
PLEASE NOTE THE FOLLOWING:
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (
https://listserv.uga.edu/).