Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72772

Substracting a date variable from another to find out duration of episode

$
0
0
Hi! I'm working with a database that has two date variables in the following format:
Year (4 positions), month (2 positions) and day (2 positions).

So if a contract began on December 31 of 1985, the number in that variable would be: 19851231 (YYYYMMDD).

Now, those two date variables pinpoint the moment an episode began and when it ended. I want to find out the duration of the episode, so I would like to subtract one from the other. I'm kind of lost, since making a simple substraction is not possible, as it's not a natural number or anything, but rather a sort of ordinal date.

Thank you so much for your help!

Viewing all articles
Browse latest Browse all 72772

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>