Hi all,
I have the below code:
With the intention that the difference between two dates is recoded into one of the above three categories. However, as you can see in the attached screenshot this is working perfectly for everything except row 2 (which should be 'Returned after 7 days", but instead is showing as "Returned after 14 days"). I cannot figure out what's happening here. Can anyone else?!
In case it's helpful, the code I've used for DateDiff is:
Thank you!
I have the below code:
Code:
recode DateDiff (7/13=1 "Returned after 7 days")(14/27=2 "Returned after 14 days")(28/max=3 "Returned after 28 days"), generate(ReturnDates)
In case it's helpful, the code I've used for DateDiff is:
Code:
gen DateDiff = LastSeen2 - OnboardingDate2
Comment