Date settings, quarter

Hi,

I have to type a proper date range into SAP.
And I need to always set a range which is a quarter
Example
if we have 09.12.2021 → quarter 4
01.10.2021 - 31.12.2021
if we have 03.04.2021 → quarter 1
01.01.2021 - 31.03.2021
How can I do it in StudioX?

Hey,
try something like this:
image
month = DateTime.Today.Month → integer
(Math.Floor((month-1)/3)+1) → quarter


In StudioX it seems to be not that easy

If you are using write line activity you have to use (Math.Floor((month-1)/3)+1).tostring3

/edit. Sorry You’re right. In studioX it doesn’t work. I will take a look and will let you know.

Hey,
now it’s works:


image

NewBlankTask.zip (49.3 KB)

1 Like

Hi
Yes it is working!
and one more small question


I have to find a current year but be able to use this value later on. As for now Var3 can not be used inside Type in or Write line because it is Int how to have a String

When you using ‘save for later’ activity - click plus button and choose number as type of variable.
And it’s works fine :slight_smile:
image
image

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.