Jump to content

This topic is 8149 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I don't know what information you are starting with (current month? current date?), so I can't give you an exact forumla. The principle is to take the first day of the next month and subtract one from the date (11/1/2002 - 1 = 10/31/2002). The advantage of this approach is you automatically take leap years into account.

-bd

Posted

No there is no one function that will do it, but you could get there with a formula combining the Case( ) and Month( ) functions, along the lines of:

Case(Month(GivenDate + 1) <> Month(GivenDate), "**Last Day of Month**")

Posted

I mean it is a given date ...how do we know it is the last day of that given date

Example: any given date: 2002-8-30 ...not the last day of that month of that given date (2002-8-30)

but 2002-8-31 ...it is the last day of that month of the date 2002-8-31

The way u said is good ...can we also calcualte next month? moth(givandate) +1 ...is that correct?

Thanks

Posted

The formula I suggested should work for any date which is supplied as 'GivenDate'.

As regards your second question about calculating the next month, there is a problem with your suggestion, Month(GivenDate) + 1 in that if GivenDate is in December, it will return 13. However Month(Month(GivenDate) + 1) will work for all cases.

This topic is 8149 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.