• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 36
  • Last Modified:

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

I have a form with two fields.  One is txtStartDate.  The other is txtEndDate.  If I enter 10/1/2015 in the first field I want the 2nd field to populate with the last date of the month I entered in the first field.  Or in this case, 10/31/2015.

But if I entered 2/1/2012 in the 1st field I'd want 2/29/2012 to populate the 2nd field.

What would the control source be for the 2nd field?
0
SteveL13
Asked:
SteveL13
2 Solutions
 
aikimarkCommented:
=DateAdd('m', 1, [txtStartDate]) - 1

Open in new window

0
 
Rey Obrero (Capricorn1)Commented:
here is a formula to get the end of the month date based on the entered date

dateserial(year(Date),Month(date)+1,0)

=dateserial(year( txtStartDate),Month( txtStartDate)+1,0)
0
 
SteveL13Author Commented:
They both worked and you posted within one minute of each other.  Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now