Hi
and sorry for the “trivial” post, but, I have a lot of difficulty understanding how to use the System.Globalization to manipulate dates.
I have to build a bot, which works only on Mondays, intercepting data from the previous week.
The bot works on SAP, and must set a date range in a query: from Monday (last week) - to Friday (last week)
Basically, I would need help on this:
I would need to know what number it was last week (ex for now: 6_2021)
with this data, intercept which date was Monday (01/02/2021)
and which date was Friday (05/02/2021) of the previous week.
I must use this approach for the eventual recovery of sessions related to the previous weeks.
Basically, I thought that the bot should read the week from a table, and with respect to the week number in the table, calculate the appropriate range date.
I’m really clumsy with handling text strings and System Globalization … sorry sorry sorry…
Hi ppr
thanks for your reply…
Unfortunately I was unable to use your information, although I think quite valuable.
I’m sorry. As already mentioned,
with strings and dates are very weak.
In my flow, I should read the week number in a table.
and from that, derive the Monday and Friday dates of the previous week.
Right now, my flow does the opposite.
From today’s date, calculate the previous Monday and Friday, and get the week number.
What I need is to start from the week number: 7_2021
and through this, obtain Monday and Friday of the previous week.
Maybe I already have the elements to do this, but I don’t know how to combine them correctly.
Sorry…
Hello PPR.
Sorry for the delay in answering, I only found time now.
Your solution is perfect.
Now I can read from DB the “week + _ + year”, to which I assign the variable “strInput”.
now I just have to convert the dates to the dd.mm.yyyy format and that’s it.
WoW!
Thank you! Very useful.