Hi,
Can any one suggest me,
for example If you run the job on Monday it will give coming Wednesday date, or if run the Same job after 4 days, on Friday it will print next week Wednesday Date.
Thanks in advance.
Hi,
Can any one suggest me,
for example If you run the job on Monday it will give coming Wednesday date, or if run the Same job after 4 days, on Friday it will print next week Wednesday Date.
Thanks in advance.
You can do some math here, like
int dayOfWeek = dayOfWk(mkDate(07,11,2015));
info (strfmt("%1", mkDate(07,11,2015) + (7 - dayOfWeek - 4 + (dayOfWeek > 3 ? 7 : 0))));
Thank you Krathi,
My question is not exactly 4 days later, when ever you run job, it will print next Wednesday date.
In Detail my question
How to print next Friday date from job, if you run the job on Monday it Will print coming Friday date , or if you run the job on Thursday it Will print next day(Friday) date, if you run the job Saturday it will print next week Friday date …, I thought, it is clear my question ?
Thank you for valuable answer Kranthi.
I would do something like this:
daysToAdd = (dayOfWeek - targetDayOfWeek) mod 7;
newDate = origDate + daysToAdd;
Thank you Martin your Suggestion.
I could have simplified it,
(3 - dayOfWeek + (dayOfWeek > 3 ? 7 : 0))
I am not adding 3 or 4 days here, 3 here is the Wednesday (3rd day in the week)
If you want Friday, replace it with 5
If a reply (replies) answered your question, please don’t forget to mark it as the verified solution.