How can I calculate a quarter of a year

i need help guys i want when i run the code in Apr for example i want the date to be 31/03/yyyy
or like i run the program in Jul the date will be 30/06/yyyy

1 Like

@Waleed_Albariqi

Check below for your reference

Hope this will help you

Thanks

Hi @Waleed_Albariqi

Please use “datetime.now.month” which provides the current month , based on that you can have the dates accordingly.

well guys i want also the last date

not just the month

Hi @Waleed_Albariqi

Have a look on the thread

Regards
Gokul

31/03/yyyy
30/06/yyyy
30/09/yyyy
31/12/yyyy
when i run it in first quarter the date should be 31/03/yyyy
and so on

can you plz send me the code

Hi,

do a switch case:

Case1:
(Now.Month/3)<=1
Then
“31/03/” + Now.Year.ToString

Case2:
1<(Now.Month/3)<=2
Then
“30/06/” + Now.Year.ToString

Case3:
2<(Now.Month/3)<=3
Then
“30/09/” + Now.Year.ToString

Case4:
3<(Now.Month/3)<=4
Then
“30/12/” + Now.Year.ToString

Regards