Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to get week # of Month

Featured Replies

seems simple ...

 

There's week of year function,,

 

How do I get  get Week Of Month ?

 

 

 thank you

Solved by dansmith65

Go to solution
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"?

  • Author

for instance what week is may 27  what

 

weekof month()   

 

===   5th week of month    etc

 

 

and thanks this sunday

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 ?

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,

  • 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.

  • 2 weeks later...
  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.