I have partial dates from three different variables , (imputations not required )
From.year (having year as "2022" and some blank values)
From.month(having month as "12" and some single digit values "2")
From.day(having day as "27", and some single digit values "5")
I need to concatenate all three From.year-From.month.From.day
if From.year and missing (From.month) then New_date = 2022
if From.year and not missing (From.month) then New_date = 2022-12
if From.year and not missing (From.month) , for single value in month 2 then New_date = 2022-02
if From.year and not missing (From.month) and not missing (day), then New_date = 2022-02-27
if From.year and not missing (From.month) and not missing (day), for single value in day 5 then New_date = 2022-02-05