I've was using the week() function, but that function returns me the week number of the year.
But I've need the monthly week number.
I don't need the complete week, can be incomplete.
Example:
Monday | Tuesday | Wednesday | Thursday | Fryday | Saturday | Sunday | ||
01 | 02 | Week number 1 | ||||||
03 | 04 | 05 | 06 | 07 | 08 | 09 | Week number 2 | |
10 | 11 | 12 | 13 | 14 | 15 | 16 | Week number 3 | |
17 | 18 | 19 | 20 | 21 | 22 | 23 | Week number 4 | |
24 | 25 | 26 | 27 | 28 | 29 | 30 | Week number 5 |
Any suggestions ?
Tks !
if(month(weekend(data))= month(data),div(day(WeekEnd(data)),7),div(day(Weekend(data,-1)),7)+1)+1 as WeekNumber,
maybe you can use:
=week(date) - week(monthstart(date)) + 1
= week(date) - week(monthend(addmonths(date,-1)))
if(month(weekend(data))= month(data),div(day(WeekEnd(data)),7),div(day(Weekend(data,-1)),7)+1)+1 as WeekNumber,
fantastic solution!
thanks
Hi
Just tried this and it shows that 1st July 2013 is in week 2, yet it is actually week 1.
Could you clarify.
Thanks
Phil
Had to use this to make it correct .....
if((week(Date) - week(monthstart(Date)) + 1)<1,1,(week(Date) - week(monthstart(Date)) + 1)) as WeekNumberInMonth,
Hi,
This script fails if Weekend ie is 7th.
Eg. If 01st is Sunday and 7th is saturday and system shows this as 2nd week instead of first week. Check this out and let me know.
Regards,
Sakthivel.S