Jump to content
  • 0

[Custom functie] Kwartaal(een_datum)


Rony Rabijns

Question

Posted

Deze custom function geeft je het kwartaal van een bepaalde datum.

 

Syntax : Kwartaal(een_datum)

 

Let (
[
HuidigJaar = Year(Get(CurrentDate))
];

Case(
Date(Month(een_datum);Day(een_datum);HuidigJaar) >= Date ( 1 ; 1 ; HuidigJaar) and 
Date(Month(een_datum);Day(een_datum);HuidigJaar) <= Date ( 3 ; 31 ; HuidigJaar);
"Q1";
Date(Month(een_datum);Day(een_datum);HuidigJaar) >= Date ( 1 ; 4 ; HuidigJaar) and 
Date(Month(een_datum);Day(een_datum);HuidigJaar) <= Date ( 6 ; 30 ; HuidigJaar);
"Q2";
Date(Month(een_datum);Day(een_datum);HuidigJaar) >= Date ( 1 ; 7 ; HuidigJaar) and 
Date(Month(een_datum);Day(een_datum);HuidigJaar) <= Date ( 9 ; 30 ; HuidigJaar);
"Q3";
Date(Month(een_datum);Day(een_datum);HuidigJaar) >= Date ( 1 ; 10 ; HuidigJaar) and 
Date(Month(een_datum);Day(een_datum);HuidigJaar) <= Date ( 12 ; 31 ; HuidigJaar);
"Q4")
)

3 answers to this question

Recommended Posts

  • 0
Posted

Omdat we zuinige hollanders zijn, hier een kortere versie.

 

Syntax: Kwartaal ( theDate )

 

"Q" & Int ( ( Month ( theDate ) - 1 ) / 3 ) + 1

 

rmw

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...