Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_skariah
Creator III
Creator III

Number of days in a month

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

1 Solution

Accepted Solutions
thomas_skariah
Creator III
Creator III
Author

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

View solution in original post

4 Replies
Not applicable

Tomr:

Does each month start with 1st or the day after last sunday of previous month?

Kiran.

thomas_skariah
Creator III
Creator III
Author

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

Not applicable

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.

thomas_skariah
Creator III
Creator III
Author

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