Hello,
I have a string variable (str10) which I want to convert into date so i can add and subtract days.
Array

This string variable is formatted in the ddmmyyyy format but some of the values are recoded as "NA" or "na" if the date is missing. When I use
gen new_date_variable = date(date_variable, dmy)

Stata just returns missing values for all.

Could anyone suggest what is the problem and how should i rectify ? Many Thanks