RodM Posted January 6, 2013 Posted January 6, 2013 seems simple ... There's week of year function,, How do I get get Week Of Month ? thank you
comment Posted January 6, 2013 Posted January 6, 2013 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"?
RodM Posted January 6, 2013 Author Posted January 6, 2013 for instance what week is may 27 what weekof month() === 5th week of month etc and thanks this sunday
Raybaudi Posted January 6, 2013 Posted January 6, 2013 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 ?
comment Posted January 7, 2013 Posted January 7, 2013 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,
dansmith65 Posted January 7, 2013 Posted January 7, 2013 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. 1
RodM Posted January 17, 2013 Author Posted January 17, 2013 thanks thats exactly what i need.. thought I ask right.. id would know this math statement..
Recommended Posts
This topic is 4386 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now