We help IT Professionals succeed at work.

How find last date of month of last year after entering the first date of a month of this year

SteveL13
SteveL13 asked
on
I want to populate a form field with the last date of month of last year after entering the first date of a month of this year.  SO if I enter 10/1/2017 in the 1st field I want 10/31/2016 to populate the 2nd field.
Comment
Watch Question

Top Expert 2016
Commented:
dateserial(year(Date)-1,Month(date)+1,0)

=dateserial(year(txtStartDate)-1,Month(txtstartdate)+1,0)