Hello!

I'm still working with dates and now have a new problem. If I have a date 22dec2014, I want 1 day before that, which is 21dec2014, I could do
Code:
gen date_pre1 = mdy(month(date), day(date)-1, year(date))
that works if the date is not the first day of a month. If I have 01jul2017, I wonder how to get 30jun2017? The code above would generate a missing value.

Thanks a lot for any help.