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.

Lazy...Calc for Quarters start and end Date

Featured Replies

Hi all,

Pretty busy and lazy to think of it..

Knowing a starting date and ending date of a Project, I want to determine the starting Quarter Date and Ending Quarter Date, based on the classic Calendar, whatever the day is.

So if project starts on feb 15 2005 and ends on November 11th 2007, I want the start date to be Jan 1st and end date to be Dec 31st 2007.

If it starts on Jan 1 2004 and ends on Jan 15th 2007, then start date is Jan 1st and end date is March 31 as the quarter was initiated on Jan 15th

If it starts on Dec 31 th, by default I want the start date to be Oct 1st even if we're just one day before end.

Thanks for the help.

I have that calc right now, but I'm not satisfied with the result

Let ( [

P = pvs_SolutionParameters::sp_periodLength;

md = Month (pd_dateStart) ;

c_P = Plancher ( md / P + ,25 ) +1 ;

M = 1+(P*(c_P-1))

];

Date ( M ; 1 ; Year(pd_dateStart) )

)

P is just a parameter to switch from quarters to semester, but you can forget about it.

Thanks

Hi Ugo,

First day of current Quarter:

Let ( [

m = Month ( date ) ;

q = Div ( m - 1 ; 3 ) ;

s = q * 3 + 1

] ;

Date ( s ; 1 ; Year ( date ) )

)

First day of next Quarter:

Let ( [

m = Month ( date ) ;

q = Div ( m - 1 ; 3 ) ;

e = q * 3 + 4

] ;

Date ( e ; 1 ; Year ( date ) )

)

In pre-7 versions, instead of Div() use:

Int ( ( Month ( date ) - 1 ) / 3 )

to compute q.

  • Author

Thanks,

That was quick enough. cool.gif

God I love this board, even my lazyness ! Well I did work at some othe stuff confidently waiting for an answer before the end of my working day...

cheers.

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.