I have a variable which containts full dates (31/01/2018), partial dates (2018-01) and missing dates. I'm not interested in missing dates and missing data points in this case is not a problem. What is seeming to be a problem is having a combination of full dates and partial dates. If it was one or the other I would be fine.
My aim is to be able to compare these full and partial dates to another date (30 April 2018, or just April 2018 if that is easier) and to see whether or not they exceed this date.
I have tried generating a new variable:
The problem is this then misses out the partial dates, and if I replace "MDY" with "YM" this then misses out all of the full dates. Any idea how I can get round this problem? I have spent most today trying to figure this out but to no avail.
Many thanks,
Jenna
My aim is to be able to compare these full and partial dates to another date (30 April 2018, or just April 2018 if that is easier) and to see whether or not they exceed this date.
I have tried generating a new variable:
Code:
gen ILISTDAT22 = date(ILISTDAT_E7_C17_2, "MDY") format ILISTDAT22 %td
Many thanks,
Jenna
Comment