Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
My financial year is from Jan to Dec and month end's on every last sunday of the month.
Can anyone suggests how to get the number of days for each month in such scenario.
Thanks in advance.
Regards,
Tomr
Hi Kiran,
Thanks for your helpful reply.
I have made some slight changes in the code and also as mentioned the month end's on last Sunday instead of that I have changed it to last Saturday of the month. Find the attached sample application.
Regards,
Tom
Tomr:
Does each month start with 1st or the day after last sunday of previous month?
Kiran.
Hi Kiran,
Thanks for your reply.
Ok, for example Jan 2012 starts on 26th Dec-2011 to 29th Jan 2012 (that is last sunday of the month)
Feb 2012 starts on 30th Jan 2012 to 26th Feb 2012 and so on.
Regards,
Tom
May be this would do:
WeekStart(MonthEnd(vDate))-WeekStart(MonthStart(vDate))
Replace vDatewith any date of a month you need no.of days for. I tried using today and got 28 and with 23-Jan-12 i got 35 as expected.
Kiran.
Hi Kiran,
Thanks for your helpful reply.
I have made some slight changes in the code and also as mentioned the month end's on last Sunday instead of that I have changed it to last Saturday of the month. Find the attached sample application.
Regards,
Tom