Thank you very much. The above script works but I do not really understand what is going on with this dataset/ time variables. I have multiple time variables stored as h:m. When I subtract them from each other like:
data table ("cstlabs")<< new column ("test", formula (
time of day(:timecst) -time of day(:timecortisol1))); the variable comes out as an integer, but if I write like this:
data table ("cstlabs")<< new column ("test", formula (
:timecst -:timecortisol1)) --> this comes out as a very strange number.
I think I am having a very difficult time using these variables, because I do not understand why this happens. For example, with the following code my entire column is blank:
data table ("cstlabs")<< new column ("AM_cort", formula (
if(hour (:Date Cortisol 1)>= 5 & hour (:Date Cortisol 1) <=9 & time of day (:time) <= time of day (:timecortisol1) , :Result Cortisol 1, 0) ));
Thank you so much!