October 11, 200223 yr IS there a function to recognise that given date is the last day of the month ... Thanks
October 11, 200223 yr 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
October 11, 200223 yr 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**")
October 11, 200223 yr Author 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
October 11, 200223 yr 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.
Create an account or sign in to comment