Calculate the last day of the month

Leesha
BronzeLounger
Posts: 1487
Joined: 05 Feb 2010, 22:25

Calculate the last day of the month

Post by Leesha »

Hi,
I am using the following code to calculate a date 10 years later then [FPSubwayREopening]. How would I change the code so that it always finds the last day of the month?

Thanks!
Leesha

DateAdd("yyyy", 10, Me.FPSubwayREopening)

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Calculate the last day of the month

Post by Rudi »

Hi Leesha,

Try this:

DateAdd("yyyy",10,DateSerial(Year(Me.FPSubwayREopening),Month(Me.FPSubwayREopening)+1,0))
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

Leesha
BronzeLounger
Posts: 1487
Joined: 05 Feb 2010, 22:25

Re: Calculate the last day of the month

Post by Leesha »

Perfect!! Thanks so much!!
Leesha

User avatar
HansV
Administrator
Posts: 78439
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Calculate the last day of the month

Post by HansV »

Or

DateSerial(Year([FPSubwayREopening])+10,Month([FPSubwayREopening])+1,0)
Best wishes,
Hans