I automated 4 extractions with UiPath studio. Each extraction is for a quarter of the year
Q1 ends on March 31st.
Q2 ends on June 30th.
Q3 ends on September 30th.
Q4 ends on December 31st.
So I would like to make 4 if statement saying:
If today’s date is March 31st or before, do the first extraction, else do not
If today’s date is June 30th or before, do the second extraction, else do not
Same goes for the 2 others.
Is it possible to wildcard the year or I would have to change my variable next year (because if I compare it to 31.03.2020, on January 1st 2021 I would still be after, but in fact before March 31st.
For the moment, I created 4 DateTime Variable with the expression : convert.ToDateTime(“03/31/2020”) by example. I then compare it to Today’s date and it works. I would like to the the same, but without considering the year.
Thank you really much for help, it is really appreciated
@BOYER_Tommy, I think this is a perfect use case for a Switch Case activity, but the if will still do the job.
you will not need to necessarily change your year variable every year, you could parse a value like this to your variable: "31.03." + Year(Now).ToString,
when you print this out, it will look like this: 31.03.2020 and the year will update itself to match current year.
Thank you really much, it is now working (tried with your formula for a good moment and realized that it was my Today’s formula which was not good (worked before but with the new formula didn’t work, I do not know why, but doesn’t matter now .) I found the good way to write my today’s formula within the reply you sent