January 6, 201313 yr seems simple ... There's week of year function,, How do I get get Week Of Month ? thank you
January 6, 201313 yr There's week of year function,, There are actually two week-of-year functions, WeekOfYear () and WeekOfYearFiscal(), giving altogether eight possible ways to define "week of year". How do you want to define "week of month"?
January 6, 201313 yr Author for instance what week is may 27 what weekof month() === 5th week of month etc and thanks this sunday
January 6, 201313 yr for instance what week is may 27 2012 or 2013 ? Because 05/27/2012 was Sunday, 05/27/2013 will be Monday, Also, what about 05/27/2006 ?
January 7, 201313 yr for instance what week is may 27 what weekof month() === 5th week of month etc and thanks this sunday That's not really an answer. I am going to take a guess here and suggest = Let ( [ firstOfMonth = Date ( Month ( date ) ; 1 ; Year ( date ) ) ; sun = firstOfMonth - DayOfWeek ( firstOfMonth ) + 1 ] ; Div ( date - sun ; 7 ) + 1 ) This behaves in a manner similar to WeekOfYear() i.e. a week starts on Sunday and fractions of weeks occurring at the beginning or end of the month count as full weeks,
January 7, 201313 yr Solution To re-iterate comments point that the answer to this question depends entirely on how you want to define "week of month", here is a real-life example: Min ( Ceiling ( Day ( Get ( CurrentDate ) ) / 7 ) ; 4 ) In this case, I needed the first 7 days of the month to be the first week, next 7 the second week and so on, returning a max value of 4, regardless of how many days were in the month. This was a very particular scenario, though, so I wouldn't expect it to be what you were looking for, but we can't know that without clarification of the question.
January 17, 201313 yr Author thanks thats exactly what i need.. thought I ask right.. id would know this math statement..
Create an account or sign in to comment